G
G
galithr2016-06-14 09:04:52
API
galithr, 2016-06-14 09:04:52

Where should the logic for working with an external API be?

Hello. For example, we have a model that stores customer data. There are also functions for interacting with a third-party API:
- obtaining data about clients from the API
- recording data about clients in the API
Actually, the question arose - where is it more correct to implement the functions of working with API in MVC - in a model or a controller?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
index0h, 2016-06-14
@galithr

Ни в первом ни во втором. Это отдельный сервис загрузки данных о пользователях. В MVC его впиховать не стоит. Вызывать его из контроллера - это ок.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question