Base solution for your next web application
Open Closed

ServiceBase vs DomainServiceBase #11576


User avatar
0
ptaylor created

I see some of the examples from the boilerplate code that class that inherits from [ProjectName]ServiceBase (mostly helpers) and [ProjectName]DomainServiceBase (Managers) resides in the [ProjectName].Core Project and can be injected in the classes that inherits from AppServiceBase (AppServices) and is placed under [ProjectName].Application Project.

So, what's the difference between the classes that inherits from [ProjectName]ServiceBase and the classes that inherits from [ProjectName]DomainServiceBase. In what condition should we prefer ServiceBase over DomainServiceBase and vice versa.

For example: UserPolicy that inherits from [ProjectName]ServiceBase.
I could not get the difference between Application Layer and Domain layer citing this class.

My question is why couldn't it inherit from [ProjectName]DomainServiceBase? What changes/complications it would have caused if inherited from [ProjectName]DomainServiceBase?


1 Answer(s)
  • User Avatar
    1
    ismcagdas created
    Support Team

    Hi @ptaylor

    Sometimes, developers need to create some classes which are not application service nor domain service, they are just helper classes. [ProjectName]ServiceBase is created for such cases and its usage should be very minimal in hte projects.