Commands and PUT endpoints

128 views
Skip to first unread message

Mathew McLoughlin

unread,
May 13, 2015, 4:15:02 AM5/13/15
to ddd...@googlegroups.com
Hey,

Apologies if this question isn't well formed but here it is.

I'm looking at a system that would be suitable for the whole CQRS/DDD/ES patterns but there is still a dependency for some outside systems to call in with wholesale updates to aggregates.

For example we have Foo and a series of decisions can be made against foo. To suspend it, to authorise it, to modify its name it in some way etc.

However we still have an external system that is outside of our control that needs to PUT in a full Foo update. I'm not sure how to handle this. At the moment I've got a couple of ideas:

- Maybe interigate the PUT request and decompose it into a series of commands. But this feels wrong

- Have a command that maps one to one with the PUT request and just push it through. But this feels a little funky too.

I was wondering if you folk have any thoughts on this?

Thanks in advance

João Bragança

unread,
May 13, 2015, 4:20:52 AM5/13/15
to ddd...@googlegroups.com
Different use case means different command

--
You received this message because you are subscribed to the Google Groups "DDD/CQRS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dddcqrs+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Bryan Watts

unread,
May 13, 2015, 12:57:00 PM5/13/15
to ddd...@googlegroups.com
The external system is making decisions outside your purview. They are events really: "system X changed Foo in Y way". The most you can do is choose to accept that into your reality; that is what you're deciding, as opposed to replicating the set of decisions already made by system X.

In that sense, you have a new command stating "make it so."

Mathew McLoughlin

unread,
May 14, 2015, 3:14:26 AM5/14/15
to ddd...@googlegroups.com
 
Thanks Guys,

Not surprised to see you two reply :) 

Derick Schoonbee

unread,
May 16, 2015, 4:15:30 AM5/16/15
to ddd...@googlegroups.com
My concern (for you) would be if this is an isolated use case / command or a sign that there might be different views of the model thus requiring some action to keep the domain "pure".

Not saying you have a legacy system but since you said "...that would be suitable for the whole CQRS/DDD/ES patterns..." take a look at  Eric Evans: http://domainlanguage.com/ddd/strategy/GettingStartedWithDDDWhenSurroundedByLegacySystemsV1.pdf  This paper could be of interest or could let you think a bit about the options. For example an Open Host Service or Anti Corruption Layer could also work. If this granular command does not belong to your domain language (dare I say "use cases"?) you can move it out to some thin ACL.

This could be over-engineering in your case and just a simple granular command would suffice... but I would keep an eye on it :)
Reply all
Reply to author
Forward
0 new messages