Define strategy to avoid need for over declaring architectural concepts #19
Labels
module: architecture
Architectural style related support
module: ddd
Domain-Driven Design related support
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:
The text was updated successfully, but these errors were encountered: