3
In an application using the concepts of DDD I am in doubt about who could inject (dependencies) in a certain class, if there is any standard for such.
This is the following between the Application, Domain and Repository layers.
1) A Customer Service (Application layer) that needs to inject user, I should inject User Applicationservice and call it User Service(Domain) or inject User Service directly into Customer Applicationservice?
2) In Clienteservice(Domain) I should inject Usuarioservice and call it Usuariorepository or I could inject Usuariorepository directly into Clienteservice?
I am worried about cyclic reference if I am injecting same level classes.
But tbm I think I should not inject the Repository of another Entity, because many times the repository methods have a rule in the service that should be called earlier.
Someone has already had this doubt, as you normally treat it?
I work with all these concepts, and I can help you, but it would be interesting if you go into more detail about your question, post the classes of your example, even the injection module if possible.
– Rodrigo K.B