Service Level Ratio

I am developing an asp.net mvc application that uses a service level. What if we have a service that depends on another service? Suppose, for example, that we have the following model:

class UserService : IUserService
{
    //implementation requires IEmailService
}    

Of course, a specific implementation of EmailService can be introduced into the UserService constructor, but, in my opinion, the service level should mediate between the user interface and the domain model, it’s like a facade. I would define a different level so that the UserService depended on the IUserModule and IEmailModule, so we could break the dependency between the services dependent on the lower level (in my modular layer). Is this the right approach?

+5
source share
3 answers

DDD ( - ) ( , , - , pdf - . - -).

, , , , . .

alt text

+6

, EmailService UserService, , ,

, , UI , .

.

, , .

, , ( ). ?

? IEmailService ? . /.

+1

Injection injection is something you should avoid, as it increases traction and complexity for the illusion of flexibility. MVC will also change its mind before starting development, because it is not good for anything more than simple CRUD operations. Web Forms is a more proven platform and is better suited for more convenient applications.

-4
source

All Articles