Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| 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 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.
Reply With Quote
  #2 (permalink)  
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
Reply With Quote
  #3 (permalink)  
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.
Reply With Quote
  #4 (permalink)  
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?
Reply With Quote
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
PHP Auction Pro ahmik Pro PHP 2 February 11th, 2019 05:18 AM
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



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


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