Click here to Skip to main content
15,887,449 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# Program Structure and File Type Advice Pin
Pete O'Hanlon17-Apr-13 2:26
mvePete O'Hanlon17-Apr-13 2:26 
AnswerRe: C# Program Structure and File Type Advice Pin
Orjan Westin17-Apr-13 2:34
professionalOrjan Westin17-Apr-13 2:34 
GeneralRe: C# Program Structure and File Type Advice Pin
Jacob Barton17-Apr-13 3:06
Jacob Barton17-Apr-13 3:06 
AnswerRe: C# Program Structure and File Type Advice Pin
Jasmine250117-Apr-13 5:58
Jasmine250117-Apr-13 5:58 
AnswerRe: C# Program Structure and File Type Advice Pin
Gerry Schmitz17-Apr-13 6:10
mveGerry Schmitz17-Apr-13 6:10 
AnswerRe: C# Program Structure and File Type Advice Pin
jschell17-Apr-13 9:16
jschell17-Apr-13 9:16 
AnswerRe: C# Program Structure and File Type Advice Pin
Jacob Barton17-Apr-13 17:03
Jacob Barton17-Apr-13 17:03 
GeneralRe: C# Program Structure and File Type Advice Pin
Orjan Westin17-Apr-13 23:43
professionalOrjan Westin17-Apr-13 23:43 
It tends to help to have an abstraction to represent anything more conceptually complex than a single number. That way, you can talk about a "node" and its properties in your code, for instance. This would let both the drawing code, the calculating code, and the storage code work with a node, and not worry about where the data comes from or is used, other than what those modules need.

Assuming you have a structure with a number of nodes, members and loads (all interconnected objects of different classes), you'd retrieve this from storage, and build it up in memory. In this case, it doesn't matter whether the storage is a database, an XML file, or the pattern in a scanned-in image, as long as the storage layer knows how to extract the data. And the storage layer is only concerned with storing and retrieving data, not how it's used.

Similarly, the drawing module would only need to know how to translate your model to points and lines the rendering engine can use, so it wouldn't need to know how the model was created.

If you were to retrieve the data needed for drawing every time it's needed, it would be very inefficient and slow, and it would make it much harder to change storage method (for instance, if you decided to set up a department database with shared models).

While I'd warn against object orientation frenzy (which is where everything is shoehorned into a huge inheritance framework whether it fits or not), it might be a good idea to read up on encapsulation and abstraction and object-oriented design (I tend to recommend Grady Booch's "Object Oriented Analysis and Design" as the go-to book).
GeneralRe: C# Program Structure and File Type Advice Pin
Jasmine250118-Apr-13 6:31
Jasmine250118-Apr-13 6:31 
GeneralRe: C# Program Structure and File Type Advice Pin
Gerry Schmitz18-Apr-13 11:15
mveGerry Schmitz18-Apr-13 11:15 
AnswerRe: C# Program Structure and File Type Advice Pin
GuyThiebaut18-Apr-13 0:27
professionalGuyThiebaut18-Apr-13 0:27 
AnswerRe: C# Program Structure and File Type Advice Pin
Clifford Nelson18-Apr-13 5:18
Clifford Nelson18-Apr-13 5:18 
AnswerRe: C# Program Structure and File Type Advice Pin
Jacob Barton19-Apr-13 2:57
Jacob Barton19-Apr-13 2:57 
QuestionThe SetAttribute does not set attribute Pin
Meysam Toluie16-Apr-13 20:22
Meysam Toluie16-Apr-13 20:22 
AnswerRe: The SetAttribute does not set attribute Pin
Jasmine250117-Apr-13 5:45
Jasmine250117-Apr-13 5:45 
GeneralRe: The SetAttribute does not set attribute Pin
Meysam Toluie18-Apr-13 1:30
Meysam Toluie18-Apr-13 1:30 
GeneralRe: The SetAttribute does not set attribute Pin
Jasmine250118-Apr-13 6:04
Jasmine250118-Apr-13 6:04 
GeneralRe: The SetAttribute does not set attribute Pin
Meysam Toluie20-Apr-13 3:02
Meysam Toluie20-Apr-13 3:02 
GeneralRe: The SetAttribute does not set attribute Pin
Jasmine250122-Apr-13 5:24
Jasmine250122-Apr-13 5:24 
AnswerRe: The SetAttribute does not set attribute Pin
OriginalGriff17-Apr-13 8:41
mveOriginalGriff17-Apr-13 8:41 
GeneralRe: The SetAttribute does not set attribute Pin
Meysam Toluie17-Apr-13 19:35
Meysam Toluie17-Apr-13 19:35 
GeneralRe: The SetAttribute does not set attribute Pin
dusty_dex17-Apr-13 23:46
dusty_dex17-Apr-13 23:46 
QuestionWhich Constructor is Better? Pin
Jasmine250116-Apr-13 12:15
Jasmine250116-Apr-13 12:15 
AnswerRe: Which Constructor is Better? Pin
Matt T Heffron16-Apr-13 12:47
professionalMatt T Heffron16-Apr-13 12:47 
GeneralRe: Which Constructor is Better? Pin
Jasmine250116-Apr-13 14:34
Jasmine250116-Apr-13 14:34 

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.