Difference beetwen @Aggregate and @AggregateRoot

429 views
Skip to first unread message

Philippe Da Costa

unread,
Mar 10, 2017, 7:22:00 PM3/10/17
to Axon Framework Users
Hi,

maybe a stupid question, but i'm not sure to understand in which case i muse use @Aggregate or @AggregateRoot ?
Where can i found some exemple ?

Thanks for your help

Benoît Liessens

unread,
Mar 11, 2017, 2:19:26 AM3/11/17
to Axon Framework Users
Hi,

I believe @Aggregate implies you aggregate class will also be annotated with Springs @Component stereotype. Which basilly allows you to apply dependency injection on aggregate types.
@AggregateRoot has no connection with Spring whatsoever.

Benoît

Allard Buijze

unread,
Mar 13, 2017, 7:11:09 AM3/13/17
to Axon Framework Users
@AggregateRoot allows you to specify the "type" name of an aggregate. It also acts as a stereotype, helping you to quickly recognize this class as an Aggregate Root.
@Aggregate is an Axon-Spring annotation (which is also annotated with @AggregateRoot), which causes the Axon-Spring autoconfiguration module to autoconfigure components for this Aggregate.

Cheers,

Allard

--
You received this message because you are subscribed to the Google Groups "Axon Framework Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to axonframewor...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages