Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0
Dear All,

As many folks know that anyone can write a working application after a few months trainning, but not everyone can write a nice and robust application in such short time of period, and in fact many programmers who had a few years experience still can't perform a best practice class design, and unfornaturely, i am one of those poor people.

I read through this link: http://msdn.microsoft.com/en-us/library/ms229042.aspx, but it is just theory and no practical examples there, what I really need is a example that can demonstrate those guidelines or principles.

I had googled the internet, but most of the post there are just theory. Can someone in here supply an example that addresses the good object oriented class design or point me to the right place that has such examples (preferable in c#).

Many thanks.
Posted 27-Jul-11 22:08pm
AndieDu764
Edited 27-Jul-11 22:31pm
v2
Comments
Amund Gjersøe at 28-Jul-11 6:01am
   
Depending on the size of your project, you should decide on a type of architecture. Simple applications can be implemented using a monolithic architecture, while bigger systems use layered architecture. Some applications can be implemented as a transcript (where a main function call all functions like GetData, ProcessData and SaveData), and some as fully object-oriented designs.
 
The classes you implement depends on your decided architecture and on your evolving design. So with your "few years experience" you should be able to do some architecture decisions and some sketching on the design of your application, before you start implementing your classes. And when you start implementing, most of the thinking is already done.
AndieDu at 29-Jul-11 2:24am
   
good suggestion, just as startup, are you able to suggest some links that involves good design of reading in a text file, manipulating the data in a specified manner and then outputting the result. Nothing more complicated than core language elements (classes, iterations, arrays, etc) and basic text file IO (reading/writing)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

As I can understand from your question, you can go through some desing patterns :
1. http://www.dofactory.com/Patterns/Patterns.aspx[^]
2. http://sourcemaking.com/design_patterns[^]
 
These links also have some good working examples.
 
You can also have a look at a good book that describes the best guidelines when you are developing a framework using .net :
http://www.google.co.in/#hl=en&q=framework+design+guidelines+pdf&oq=framework+design+&aq=1&aqi=g10&aql=&gs_sm=e&gs_upl=9792l12385l4l13504l17l15l0l2l2l0l296l2621l0.2.9l11l0&bav=on.2,or.r_gc.r_pw.&fp=38944046eb5a1414&biw=1440&bih=781[^]
 
Hope this helps.
All the best.
  Permalink  
Comments
Amund Gjersøe at 28-Jul-11 5:48am
   
Some good links there.
Pravin Patil, Mumbai at 28-Jul-11 7:25am
   
Thanks.....
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Well, AFAIK, there's no such thing as perfect example that can demonstrate all guidelines and principles. What you can probably do is search for examples per topic. Do it chunk by chunk. It gets registered easier this way, than when you are looking at a large application, which is usually overwhelming. There are plenty of articles here in CP that has code examples that you can play with. Try searching for the article of a topic you want to be familiar with.
  Permalink  
Comments
AndieDu at 29-Jul-11 2:25am
   
good suggestion, just as startup, are you able to suggest some links that involves good design of reading in a text file, manipulating the data in a specified manner and then outputting the result. Nothing more complicated than core language elements (classes, iterations, arrays, etc) and basic text file IO (reading/writing)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

I know this is an older question, but I ran into it as one of the top returns on Google while searching for Object Oriented Design (OOD) links for someone else. I thought it would be useful to add some more info for anyone else who may find this via Google, although it is rather late for the OP.
In order to properly apply OOD to code you really need to understand the theory behind good design principles. Once I read such principles I like to see a good concrete example to improve my understanding so most of the links below will have good examples. An acronym that covers several good OOD principles is SOLID. There is a basic primer on OOD and SOLID here[^]. In short SOLID stands for the following 5 principles:
1. Single Responsibility Principal[^] - A class should have one, and only one, reason to change.
2. Open/closed principle[^] - You should be able to extend a classes behavior, without modifying it.
3. Liskov substitution principle[^] - Derived classes must be substitutable for their base classes.
4. Interface segregation principle[^] - Make fine grained interfaces that are client specific.
5. Dependency inversion principle[^] - Depend on abstractions, not on concretions.
 
I also recommend reading the Head First Design Patterns[^] book.
 
For further reading there is a good series on OOP here[^] on CodeProject.
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Maciej Los 295
1 OriginalGriff 273
2 Aajmot Sk 234
3 Marcin Kozub 205
4 Richard MacCutchan 200
0 OriginalGriff 7,903
1 Sergey Alexandrovich Kryukov 7,127
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,820


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 5 Jun 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100