RE: Aggregates with dependencies
Mauro Servienti <[email protected]>
| Newsgroups | gmane.comp.programming.domain-driven-design |
|---|---|
| Message-ID | <0D71C042265E7B4D871B59569C7774D73BFABF9D@AMXPRD0310MB390.eurprd03.prod.outlook.com> |
I have something like: storeAggregate.Dosomething(); And I do *not* want to have: storeAggregate.Dosomething( User onBehalfOf ); .m -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Willem van Gool Sent: venerdì 15 febbraio 2013 08.24 To: [email protected] Subject: Re: [domaindrivendesign] Aggregates with dependencies Regarding your question, if an aggregat itself can depend on a service, id say no. It sounds like you're accessong the service in the wrong place. If you require realtime info from an external service for dag command, consider placing this logic in your handlers or as a behavior on your handlers and then forward this info to your aggregate where appropriate. On 2/15/13, Mauro Servienti <[email protected]> wrote: > Hi all, > > In our domain, financial but does not really care for the topic of the > question, each aggregate raises a lot of events one of the key > information that the event must carry with it is the user, the > application user, that it currently managing the aggregate. > We have a security service that knows who the user is and is the only > source of truth we can rely on. > > Is it fine, from a ddd perspective, that an aggregate depends on a service? > > If not, how would you solve this scenario? > > .m > > Sent from my Yellow Lumia 920 > ------------------------------------ Yahoo! Groups Links ------------------------------------