M
M
Maxim2019-01-31 23:02:58
Yii
Maxim, 2019-01-31 23:02:58

How to make connections and API in modules?

Hello! I plan to make different modules? Which must somehow interact with each other. Get some data for logic.
To do this, I have two options:
Make widgets
Make an API
How do you use it? Tell me...
For example, I'm making a geo module. It will be responsible for storing information about cities, countries and regions. He is independent of others.
Next, I create an event module. Where the city needs to be obtained from another module. It is also desirable to store id in the database, instead of a string.
How to observe the non-cohesion of modules and at the same time so that everything functions. You may have to use both the widget and api, because you also need to display the name of the city on the page, and not the id.
In general, tell me how to do it better.
And the second question is how to correctly implement the api in the module?
It would be nice to look at examples)
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2019-01-31
@myks92

according to the mind, everything is in microservices, if 1 database is possible with services, and if you need to pull the api, then the api goes to the service!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question