Answer the question
In order to leave comments, you need to log in
How does HMVC architecture work?
I read about HMVC, immediately there were questions that I could not find answers to.
All questions within the Server-Server interaction.
1) In what form is the response from the module (Triad) returned? I mean, if we return the response in JSON, then we waste time when parsing. As I understand it, for such things there is a division into internal and external requests. When internal, the framework itself should resolve and return immediately in the form of an array or an object?
2) How are things like user authorization implemented?
In each request separately? In this case, a bunch of identical requests to the database.
Or here, too, the framework should beautifully resolve internal requests (Store information about the user)?
UPD
3) How is it determined that the request is from the client? Routing?
4) Are tokens/keys used when interacting between triads? (Or should all data that is transferred between the triads be available to users as well?)
Answer the question
In order to leave comments, you need to log in
1. You can always return an array of data from a triad. And already in the case of returning them to the client - encode in JSON.
2. The user's state must remain constant throughout the entire request, if it has not been changed in the code. Therefore, this state should be stored in a kind of application wrapper, and any triad should have access to it, since the call to this triad will go through this wrapper.
It's approximately. In fact, the questions are very creative)
Here is the implementation of MVC from 0 according to the article from Habr, I added HMVC from above (see app/core/router). This project may answer new questions. https://github.com/olijen/mvc
If anything - write, I'll help.
See Symfony for an example. There for interaction between "triads" objects Request and Response are used.
HttpKernelInterface
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question