Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > Other ASP.NET > BOOK: Professional ASP.NET Design Patterns
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional ASP.NET Design Patterns
This is the forum to discuss the Wrox book Professional ASP.NET Design Patterns by Scott Millett; ISBN: 978-0-470-29278-5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET Design Patterns 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 Display Modes
  #1 (permalink)  
Old February 5th, 2013, 12:44 PM
Registered User
Points: 14, Level: 1
Points: 14, Level: 1 Points: 14, Level: 1 Points: 14, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Post DDD Questions & Design Approach

Hi,

It's the first serious ASP.NET book I ever read. Recommended for each and every ASP.NET developer.

I am kind of new to the idea of DDD. How would I go about learning how to organize my model objects? Is there a way to think when creating such objects?

Thank you
Reply With Quote
  #2 (permalink)  
Old February 5th, 2013, 12:54 PM
elbandit's Avatar
Wrox Author
Points: 599, Level: 8
Points: 599, Level: 8 Points: 599, Level: 8 Points: 599, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2007
Location: Southsea, Portsmouth, Hampshire, United Kingdom.
Posts: 107
Thanks: 11
Thanked 17 Times in 15 Posts
Default

Create objects based around behaviour rather than nouns and verbs. For example don't create a customer because there is one in real life, instead look for behaviour and model that. In an e-commerce site you have a customer and she can subscribe to a newsletter. Instead of adding all of the behaviour for newsletter subscriptions onto a customer object model a NewsletterSubscriber object. Then perhaps Customer is just the personal details of a person placing an order.

Does that make sense?
Reply With Quote
  #3 (permalink)  
Old February 5th, 2013, 01:00 PM
Registered User
Points: 14, Level: 1
Points: 14, Level: 1 Points: 14, Level: 1 Points: 14, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I end up having a NewsletterSubscriber class having a property of type Customer to capture the Customer's Email for example?

The DDD book explains such concepts?

Thanks

Last edited by bhaidar; February 5th, 2013 at 01:04 PM.
Reply With Quote
  #4 (permalink)  
Old February 5th, 2013, 01:19 PM
elbandit's Avatar
Wrox Author
Points: 599, Level: 8
Points: 599, Level: 8 Points: 599, Level: 8 Points: 599, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2007
Location: Southsea, Portsmouth, Hampshire, United Kingdom.
Posts: 107
Thanks: 11
Thanked 17 Times in 15 Posts
Default

Maybe you end up with three objects, all built for a single purpose...

Code:
public class NewsletterSubscriber
{
   private int customer_id;
   private bool send_emails_on_offers;
   private bool share_my_info_with_other_companies;
  
}
Code:
public class ContactDetails
{
   private int customer_id;
   private string email;
   private string phone_number
  
}
Code:
public class PersonalDetails
{
   private int customer_id;
   private string first_name;
   private string family_name;
  
}
The objects all have a single reason to change and are focused on a single behaviour. All linked by a corrleation id, the 'customer_id' property. You see there is no 'customer', there is no spoon. :0)
Reply With Quote
Reply


Thread Tools
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
Free DDD in C# .net book by Scott Millett (same author as ASP.NET Design Patterns) elbandit BOOK: Professional ASP.NET Design Patterns 4 August 26th, 2013 02:14 PM
Two Variable & Function optimization questions Asymmetricalman Book: Professional Flash Mobile Development: Creating Android and iPhone Applications 0 October 18th, 2012 05:44 PM
Questions about Inheritance & Polymorphism jimblanc Java Basics 1 December 31st, 2006 02:54 PM
I Need Interview Questions & Answers ... keyur_rhtdm .NET Framework 2.0 2 August 5th, 2006 10:55 AM
Design Questions trentrr182 BOOK: Expert One-on-One Access Application Development 0 December 6th, 2005 11:08 AM



All times are GMT -4. The time now is 05:57 PM.


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