Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 2012/5.0 > BOOK: Patterns, Principles and Practices of Domain-Driven Design
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 13th, 2015, 12:26 PM
Registered User
Points: 26, Level: 1
Points: 26, Level: 1 Points: 26, Level: 1 Points: 26, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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é.
Reply With Quote
The Following User Says Thank You to martinezdelariva For This Useful Post:
nick_t (July 14th, 2015)
  #2 (permalink)  
Old July 14th, 2015, 02:47 PM
Wrox Author
Points: 237, Level: 4
Points: 237, Level: 4 Points: 237, Level: 4 Points: 237, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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
Reply With Quote
The Following User Says Thank You to nick_t For This Useful Post:
martinezdelariva (July 15th, 2015)
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 06:50 PM.


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