Design of an aggregate controlling a long-running process

207 views
Skip to first unread message

Sean Farrow

unread,
Dec 18, 2017, 4:51:43 PM12/18/17
to ddd...@googlegroups.com

Hi all,

 

I’m designing part of a bounded context and have an entity that deals with a customer search that is in itself a long running process.

There are two types of search, one that requires media such as an image and another that doesn’t.

 

Two questions spring to mind:

Firstly, how should I kick off the long-running process from within the aggregate or from an external stimulus (I could have my command handler call a start search method if that would be the best idea)? As a follow-up, should my aggregate even managethe search process?

Secondly, should I have an aggregate for each type of search? The only difference from a domain experts point of view is one type requires media and the other doesn’t.

Any help appreciated.

Kind regards

Sean.

 

mynkow

unread,
Dec 19, 2017, 6:20:30 AM12/19/17
to DDD/CQRS
I always see search as a projection. May be I am missing something. How the search could be a long running process? When you search you get results in several ms.

Ramin

unread,
Dec 20, 2017, 5:55:45 AM12/20/17
to DDD/CQRS
No, it doesn't sound like the aggregate shout manage the search process. Aggregates implement business rules and protect invariants.
Cheers
Ramin

pg2000

unread,
Jan 11, 2018, 2:22:36 PM1/11/18
to DDD/CQRS
Hey Sean,

i think an optimized read model should be the way.
So you doesn't need an aggregate for this.

Cheers 


Am Montag, 18. Dezember 2017 22:51:43 UTC+1 schrieb Sean Farrow:

Manuel Rascioni

unread,
Jan 12, 2018, 2:08:47 PM1/12/18
to DDD/CQRS
I think you should have something that listen to the aggregate creation and start the search process.
The aggregate state can include the search params, when the process is done it sends a command to the aggregate sending it the search results (or a reference to the search results).
Reply all
Reply to author
Forward
0 new messages