xmolecules / jmolecules

Libraries to help developers express architectural abstractions in Java code
http://jmolecules.org
Apache License 2.0
1.26k stars 105 forks source link

DDD `@ApplicationService` and `@DomainService` #145

Closed FlorianPatzer closed 5 days ago

FlorianPatzer commented 6 days ago

Why are there no two annotations, one for application service and one for domain service in jmolecules-ddd? Instead it contains one @Service annotation which is described as "domain service". That makes no sense, does it?

odrotbohm commented 5 days ago

DDD in its core doesn't distinguish between the two. Only when it references the layered architecture style. Consequently, those annotations are contained in the jmolecules-layered-architecture artifact, as other separation of concerns architectures exist (onion, hexagonal) and, generally speaking, the concern is orthogonal to the DDD building blocks.

FlorianPatzer commented 3 days ago

OK then why is @Service explicitly called a domain service in its description?: "Identifies a domain {@link Service}."

odrotbohm commented 3 days ago

It's not explicitly called that. We're talking about domain concepts and Domain-Driven Design. All stereotype elements are part of the domain in that regard.