Open odrotbohm opened 3 years ago
There are way too many @Domain...
annotations defined in the jmolecules to make the semantic derivation safe. I doubt it will be safe to derive ALL of those for @AggregateRoot
:
@DomainLayer
@DomainServiceRing
@DomainModelRing
@DomainRing
A set of the ArchUnit rules enforcing particular combination would be more useful, as projects then may decide which combination (one or many) fits the context.
Also, the dependency on the implicit annotations makes architectural checks fragile. I would insist on explicit declarations in the projects I'm working for.
Thanks for the feedback, Illya. I share your concerns and it's very likely that we end up doing just nothing for now. It's still good to have the ticket around to gather feedback.
jDDD artifacts are designed to be usable as independently as possible. E.g. the onion architecture annotations are usable completely without the building blocks annotations in jDDD Core. That however also imposes an interesting challenge. Let's say your project combines the two artifacts. To benefit from both the declarations, you would now have to do the following:
This is basically expressing the same thing twice as you could argue that from the fact, that
MyAggregate
is an@AggregateRoot
, it belonging to the domain layer is implicit.A very direct solution for that would be to meta-annotate
@AggregateRoot
with@DomainLayer
. However, that would introduce a dependency in the wrong direction and kind of imply that jDDD Core annotations would imply onion architecture, despite that technical dependency not be a strong one at runtime (as annotations can be missing without failure). It would be logically more consistent to transparently "annotate"MyAggregate
with@DomainLayer
if it is annotated with@AggregateRoot
and jDDD Onion Architecture is in use.There are two options to achieve that: