Wrox Programmer Forums
|
BOOK: Patterns, Principles and Practices of Domain-Driven Design
This is the forum to discuss the Wrox book Patterns, Principles and Practices of Domain-Driven Design by Scott Millett; ISBN: 978-1-118-71470-6
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Patterns, Principles and Practices of Domain-Driven Design section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 13th, 2015, 12:26 PM
Registered User
 
Join Date: Jul 2015
Posts: 3
Thanks: 2
Thanked 1 Time in 1 Post
Default One aggregate modification per use case

Hola!

As I had understood, only one aggregate could be modified and persisted to data store in a request.
However in Chapter 21, figures 21-15, 21-19 and 21-20 show an example where "order" and 'account' aggregates are modified in the same request.

Please, could you explain this behavior? Isn't a strong rule? Are there reasons to break the rule?

Thanks and congratulations for the book!
José.
The Following User Says Thank You to martinezdelariva For This Useful Post:
nick_t (July 14th, 2015)
 
Old July 14th, 2015, 02:47 PM
Wrox Author
 
Join Date: May 2015
Posts: 59
Thanks: 1
Thanked 5 Times in 5 Posts
Default

Hi,

In my opinion it's a firm rule but not an absolute one. Sometimes it's best to save multiple aggregates in one transaction. But if you find yourself doing it a lot it can indicate that there are design issues with your model. It can also cause locking problems, where you are locking lots of database rows at once.

You're right about listing 21 - 15. However, this is an example where you really do have 2 aggregates being updated in the same transaction so support a genuine business policy.

We discussed these scenarios in a bit more detail in the aggregates chapter, chapter 19. Instead of saving 2 aggregates in the same transaction, we could have used asynchrony, but that would have introduced asynchrony.

Basically, sometimes its the best approach, but if you find yourself doing it a lot, I would recommend looking at your model and justifying each case.

Cheers
The Following User Says Thank You to nick_t For This Useful Post:
martinezdelariva (July 15th, 2015)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Webshop modification El Presidente BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 21 December 6th, 2006 03:14 PM
Kernal Modification!!HOW????? harsh_hot Linux 3 May 28th, 2006 09:23 PM
Aggregate Function Adamcg Access 3 December 5th, 2005 09:24 AM
search string either Upper case or lower case rylemer Beginning VB 6 3 March 24th, 2004 04:23 PM
Check Case in a Case-Insensitive DB nbryson SQL Language 1 January 23rd, 2004 07:36 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.