View Single Post
  #4 (permalink)  
Old February 5th, 2013, 01:19 PM
elbandit's Avatar
elbandit elbandit is offline
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