Answer the question
In order to leave comments, you need to log in
Law of Demeter and Doctrine?
Hello.
I have a question regarding the connectivity of modules in a web project developed in PHP.
Doctrine is used as ORM.
If the modules should not know about each other (they have limited information available through services), then what about the situation when complex selections with filters, aggregation, affecting the entities of other modules should be made in some modules?
Doctrine is good at managing relational relationships between entities. And if the modules communicate with each other only through services, and without describing relationships through Doctrine, then this will seriously affect performance.
How then to be?
Thanks in advance for your replies!
Answer the question
In order to leave comments, you need to log in
You can consider a scheme in which the module itself provides others with the opportunity to use its data. In this case, an external interface with a method that completes the external request in accordance with the filters that are passed to the function. As well as a method that returns a description of possible filters - so that the question of what can be requested from the module is decided not outside it, but in itself. So the external module will not know anything about the one being used, but at the same time it will be able to use its data.
then what about the situation when complex selections with filters, aggregation, affecting the entities of other modules should be made in some modules?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question