Click here to Skip to main content
15,914,070 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: A software engineering debate/question Pin
Nagy Vilmos27-Mar-14 3:32
professionalNagy Vilmos27-Mar-14 3:32 
GeneralRe: A software engineering debate/question Pin
OriginalGriff27-Mar-14 3:38
mveOriginalGriff27-Mar-14 3:38 
GeneralRe: A software engineering debate/question Pin
Ennis Ray Lynch, Jr.27-Mar-14 3:42
Ennis Ray Lynch, Jr.27-Mar-14 3:42 
GeneralRe: A software engineering debate/question Pin
PIEBALDconsult27-Mar-14 3:45
mvePIEBALDconsult27-Mar-14 3:45 
GeneralRe: A software engineering debate/question Pin
mikepwilson27-Mar-14 3:40
mikepwilson27-Mar-14 3:40 
GeneralRe: A software engineering debate/question Pin
Master.Man198027-Mar-14 3:57
Master.Man198027-Mar-14 3:57 
GeneralRe: A software engineering debate/question Pin
Eddy Vluggen27-Mar-14 3:59
professionalEddy Vluggen27-Mar-14 3:59 
GeneralRe: A software engineering debate/question Pin
BobJanova27-Mar-14 4:37
BobJanova27-Mar-14 4:37 
I would always write the first unless there is a very good reason not to. Sometimes it may not be an object type, it may be an interface, if you only want to deal with a particular facet of your model – sometimes model classes need to implement several interfaces if they cover an object that is used in a lot of places, but that's okay (although it should lead you to question whether your data model is the best).

The only time I'd write code with IDs is in low level database or external API access classes. Anywhere else I'll define an interface for the actions I want to perform on an object, and if necessary a GetXxx(int id) method which looks up enough of an object to populate the interface.

If we're talking about object mapping frameworks then you should be able to construct an object over a query and have it load things on demand at which point you might as well just use the domain objects directly; only the relevant parts will need to be populated.
GeneralRe: A software engineering debate/question Pin
Joe Woodbury27-Mar-14 8:25
professionalJoe Woodbury27-Mar-14 8:25 
GeneralRe: A software engineering debate/question Pin
_Maxxx_27-Mar-14 14:38
professional_Maxxx_27-Mar-14 14:38 
RantWell the battle continues Pin
glennPattonWork327-Mar-14 3:02
professionalglennPattonWork327-Mar-14 3:02 
GeneralRe: Well the battle continues Pin
jeron127-Mar-14 5:35
jeron127-Mar-14 5:35 
GeneralRe: Well the battle continues Pin
glennPattonWork327-Mar-14 5:41
professionalglennPattonWork327-Mar-14 5:41 
GeneralRe: Well the battle continues Pin
jeron127-Mar-14 5:54
jeron127-Mar-14 5:54 
GeneralRe: Well the battle continues Pin
glennPattonWork327-Mar-14 6:06
professionalglennPattonWork327-Mar-14 6:06 
GeneralRe: Well the battle continues Pin
jeron127-Mar-14 6:38
jeron127-Mar-14 6:38 
GeneralRe: Well the battle continues Pin
glennPattonWork327-Mar-14 6:44
professionalglennPattonWork327-Mar-14 6:44 
GeneralRe: Well the battle continues Pin
jeron127-Mar-14 6:47
jeron127-Mar-14 6:47 
GeneralBahamas Splits Pin
Dalek Dave27-Mar-14 2:05
professionalDalek Dave27-Mar-14 2:05 
GeneralRe: Bahamas Splits Pin
Blue Waffle27-Mar-14 2:14
Blue Waffle27-Mar-14 2:14 
GeneralRe: Bahamas Splits Pin
mikepwilson27-Mar-14 3:35
mikepwilson27-Mar-14 3:35 
GeneralRe: Bahamas Splits Pin
Madhava Verma Dantuluri27-Mar-14 2:21
Madhava Verma Dantuluri27-Mar-14 2:21 
GeneralRe: Bahamas Splits Pin
Mike Hankey27-Mar-14 2:26
mveMike Hankey27-Mar-14 2:26 
GeneralGimli and Gloin got about a bit didn't they Pin
Dalek Dave27-Mar-14 2:02
professionalDalek Dave27-Mar-14 2:02 
RantDamned you Skype! Damned you and your kin! Pin
Nagy Vilmos27-Mar-14 0:24
professionalNagy Vilmos27-Mar-14 0:24 

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.