The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

DTO Objects Vs. Structures

I like the idea of using small dumb objects to pass info to and from objects, but assuming you aren't going to add any serialization methods (i.e., getXML();) is there any reason not to use a structure for this?
Curtis Erhart Send private email
Wednesday, May 16, 2007
 
 
AFAIK, in C++, the only significant difference between a class and a struct is that the former defaults to private while the latter defaults to public. So don't think/talk about it too much, just pick one and go for it.
Jeroen
Wednesday, May 16, 2007
 
 
In C# structures are value types and are always created on the stack. So it looks like they're ment to be used as a simple structured primitive-like data types.
When you pass a structure as a method argument all it's content is copied and put on the stack.
With a large amount of methods that pass the structure variable as a parameter it can affect performance.
el suchy Send private email
Wednesday, May 16, 2007
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz