none
Two Very Similar Objects.

    Question

  • I have two very similar Items that I want to capture as Objects.  

    I'll use the example as I make Cars with and with out head lights.  Should I just make two constructors?  If I do this I have to sprinkle logic in my UI layer and my DataObject layer to persist the data correctly.

     

    Thoughts?

     

    Thanks in advanced.

     

    Bryan

     

     

     

     

     

     

    Tuesday, August 28, 2007 4:12 PM

Answers

  • to me it sounds as though the headlight is an attribute (property) of the class car. I usually do create multiple constructors for class that do allow you set the attributes during construction - especially if the property is read only.

     

    If you are changing the properties of a class I would expect you have to modify some code.

     

    HTH

     

    Ollie Riches 

    Tuesday, August 28, 2007 7:32 PM

All replies

  • to me it sounds as though the headlight is an attribute (property) of the class car. I usually do create multiple constructors for class that do allow you set the attributes during construction - especially if the property is read only.

     

    If you are changing the properties of a class I would expect you have to modify some code.

     

    HTH

     

    Ollie Riches 

    Tuesday, August 28, 2007 7:32 PM
  • Exactly.  The headlights would be a attribute.  Thanks for the help, this is the direction I will go.

     

    Bryan

     

     

    Tuesday, August 28, 2007 7:41 PM