Click here to Skip to main content
15,887,822 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
GeneralRe: OOP Programming, Two approachs for a problem Pin
Jonathan Davies23-Mar-09 8:25
Jonathan Davies23-Mar-09 8:25 
GeneralRe: OOP Programming, Two approachs for a problem Pin
Quake2Player23-Mar-09 8:42
Quake2Player23-Mar-09 8:42 
GeneralRe: OOP Programming, Two approachs for a problem Pin
led mike23-Mar-09 8:31
led mike23-Mar-09 8:31 
AnswerRe: OOP Programming, Two approachs for a problem Pin
Quake2Player24-Mar-09 7:31
Quake2Player24-Mar-09 7:31 
GeneralRe: OOP Programming, Two approachs for a problem Pin
Jonathan Davies24-Mar-09 8:51
Jonathan Davies24-Mar-09 8:51 
Questioncomposite pattern serializing Pin
Jarno Burger20-Mar-09 13:18
Jarno Burger20-Mar-09 13:18 
AnswerRe: composite pattern serializing Pin
Jonathan Davies22-Mar-09 5:14
Jonathan Davies22-Mar-09 5:14 
QuestionObject Oriented Design - object graphs and lookup table data Pin
Leftyfarrell13-Mar-09 2:09
Leftyfarrell13-Mar-09 2:09 
I would like to get some ideas on the best way to handle dealing with data in an object oriented system. Consider:

User
=======
UserId
UserTypeId
FirstName
LastName
OrganizationId

UserType
===========
UserTypeId
Name

Organization
============
OrganizationId
Name
District
YearFounded

How would you model these database tables with your objects?

For simple lookup table data, would User have a property for just UserTypeId or would it have a property of UserType(which includes both Id and Name)?

For more complex data, would User have a property for just OrganizationId or would it have a property of Organization?

If you go the route of having only an Id as property, how do you manage the display of property data, for instance, when displaying the User in the UI, you still need to display the UserType.Name value, and not just the Id. Would you load and cache a collection of UserType objects and use this to lookup the UserType.Name value when needed?

Would it make sense to expose a readonly property User.UserTypeName for convenience that provides the name value? I say readonly since you can edit the Id value, but not the actual UserType name when saving a user.

The object graph can grow large with several interactions... what rules do you use to draw the line as to where an object instance and its related graph stop?

Thanks for any opinions. Assume the objects must be WCF friendly for use as data contracts.
AnswerRe: Object Oriented Design - object graphs and lookup table data Pin
led mike13-Mar-09 5:03
led mike13-Mar-09 5:03 
GeneralRe: Object Oriented Design - object graphs and lookup table data Pin
Leftyfarrell14-Mar-09 3:58
Leftyfarrell14-Mar-09 3:58 
QuestionEmpty abstract method override -- good or bad design? Pin
brontofuzik12-Mar-09 10:46
brontofuzik12-Mar-09 10:46 
AnswerRe: Empty abstract method override -- good or bad design? Pin
Luc Pattyn12-Mar-09 10:57
sitebuilderLuc Pattyn12-Mar-09 10:57 
AnswerRe: Empty abstract method override -- good or bad design? Pin
Mark Churchill12-Mar-09 14:39
Mark Churchill12-Mar-09 14:39 
GeneralRe: Empty abstract method override -- good or bad design? Pin
Luc Pattyn12-Mar-09 15:05
sitebuilderLuc Pattyn12-Mar-09 15:05 
GeneralRe: Empty abstract method override -- good or bad design? Pin
Mark Churchill12-Mar-09 15:14
Mark Churchill12-Mar-09 15:14 
QuestionTechnical Design vs. Implementation vs. Testing Pin
shakhtyor12-Mar-09 10:45
shakhtyor12-Mar-09 10:45 
AnswerRe: Technical Design vs. Implementation vs. Testing Pin
Perry Holman22-Apr-09 0:16
Perry Holman22-Apr-09 0:16 
AnswerRe: Technical Design vs. Implementation vs. Testing Pin
Robin_Roy23-Jul-09 16:38
Robin_Roy23-Jul-09 16:38 
QuestionLearning UML Pin
Brendan Vogt11-Mar-09 23:45
Brendan Vogt11-Mar-09 23:45 
AnswerRe: Learning UML Pin
User 171649212-Mar-09 0:17
professionalUser 171649212-Mar-09 0:17 
AnswerRe: Learning UML Pin
shakhtyor12-Mar-09 10:25
shakhtyor12-Mar-09 10:25 
QuestionUML Software Pin
Brendan Vogt10-Mar-09 21:08
Brendan Vogt10-Mar-09 21:08 
AnswerRe: UML Software Pin
Pete O'Hanlon10-Mar-09 22:27
mvePete O'Hanlon10-Mar-09 22:27 
AnswerRe: UML Software Pin
User 171649210-Mar-09 22:46
professionalUser 171649210-Mar-09 22:46 
QuestionRe: UML Software Pin
Brendan Vogt11-Mar-09 23:44
Brendan Vogt11-Mar-09 23:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.