Design process

Soldato
Joined
1 Mar 2003
Posts
5,508
Location
Cotham, Bristol
I find it fairly easy to pick up a new programming language and just play.

Something i've never really done though is to properly design a "GOOD" solution (using UML/design patterns), I know what the UML is and I have an understanding of some design patterns.

It's always confused me however how to put these things into practice!

What methods do people here use/recommend?
 
Hi,

One of the first things I try to do is to split the problem up into chunks without thinking about the actual coding in them. These will eventually translate into small items of code that will hopefully be reusable. If you're using an OO design then this tends to drop out of the classification of the problem i.e deriving the objects, methods etc. If you're doing something non OO then work out common behaviour etc. and go from there.

Procedures/methods etc. should be kept small (if possible) and should perform a single task (this also helps makes them more re-useable). Keep conditional behaviour in them to a minimum as it just makes things complex later on.

Your program should then consist of a small core that invokes methods on objects, or procedures/functions in a non-OO program. If your core code gets long and full of conditions etc. then look to see how these can be broken down etc. It's an iterative process of investigation, design and a bit more investigation, design etc. until you're happy.

If your code is maintainable, expandable, and works then the design is often good enough for the job. (Every design can always be improved with hindsight.) I found the design patterns were good for some things but don't stick rigidly to them. Discovering your own way to do things is a good way to learn.

Hope that helps,
Jim
 
Back
Top Bottom