Wrox Programmer Forums
| 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 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 May 29th, 2015, 10:47 PM
Authorized User
Points: 136, Level: 2
Points: 136, Level: 2 Points: 136, Level: 2 Points: 136, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2015
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default Auction and Bids

On Page 449, there is a mentioning of invariants. First of all, I have seen this term invariants in many articles but not clear what it is. Does it mean business validations?

When I think about an Auction and Bids, I think Auction can be an aggregate. This is because an auction can't exist without a bid. If anyone wants to access the bid, it has to go through the auction.

Please clarify.
 
Old May 30th, 2015, 03:41 AM
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

An invariant is relationship between two things that must always fall within a certain range. For example, a soccer match must have two teams else it's not a soccer match.

In the examples of auctions and bids, you can have an auction that has no bids. When an auction starts, there are no bids placed. So in most auction domains, I don't think an auction have at least 1 bid would be an invariant.

Invariants aren't necessarily business rules, they can be facts about he problem domain as with the soccer match example I gave.

Thanks for posting your question.

Hope that helps
 
Old May 30th, 2015, 06:45 AM
Authorized User
Points: 136, Level: 2
Points: 136, Level: 2 Points: 136, Level: 2 Points: 136, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2015
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default Invariants

A very good explanation. I also read Udi's explanation on a similar analogy.
 
Old August 19th, 2015, 08:15 PM
Registered User
Points: 19, Level: 1
Points: 19, Level: 1 Points: 19, Level: 1 Points: 19, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2015
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Still Confusing

Yes, the auction can exist without any bids, but the auction must have an associated listing, otherwise it's not an auction. So, shouldn't the auction be th e aggregate root for that reason?

Or, with the question/answer aggregate, does the answer really need to be aggregated with the question? If a question exists, but has not been answered yet, wouldn't the question still be in a consistent state?




Similar Threads
Thread Thread Starter Forum Replies Last Post
Chap 12, P. 374: How to open 'Package Migrate Wizard' from BIDS? cJeffreywang BOOK: Professional SQL Server 2005 Integration Services ISBN: 0-7645-8435-9 1 March 20th, 2009 02:08 PM





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