I’m sure most of the good programmer like me probably don’t write any code until we build a picture in our mind of what the code does and how the pieces of the code interact.The more that you can picture this, the more likely you are to feel comfortable that you have developed the best solution to the problem. If you don’t get this right away, you may keep staring out the window for a time if you are lucky to have a nice view from your office and if not then you may be staring at your desktop, even though the basic solution to the problem is quite obvious.
I feel that it’s very important for any programmer to develop a best elegant solution. The more elegant solution it is the more reusable it will be. That is why it is very important to satisfy this need for elegant, but simple, reusable solutions. That’s where the term "design patterns" comes in picture. It may sound very formal when you first encounter it but, in fact, design patterns are just convenient ways of reusing object oriented code between projects and between programmers.The idea behind design patterns is simple—write down and catalog common interactions between objects that programmers have frequently found useful.
Some useful definitions of design patterns
“Design patterns are recurring solutions to design problems you see over and over.” (The Smalltalk Companion)
“Design patterns constitute a set of rules describing how to accomplish certain tasks in the realm of software development.” (Pree 1994)
“Design patterns focus more on reuse of recurring architectural design themes, while frameworks focus on detailed design and implementation.” (Coplien and Schmidt 1995)
“A pattern addresses a recurring design problem that arises in specific design situations and presents a solution to it.” (Buschmann et al.1996)
“Patterns identify and specify abstractions that are above the level of single classes and instances, or of components.” (Gamma et al., 1993)
In next coming blogs, I will be discussing around 20 design patterns divided into three types: creational,structural, and behavioral.
Creational patterns create objects for you rather than having you instantiate objects directly. This gives your program more flexibility in deciding which objects need to be created for a given case.
Structural patterns help you compose groups of objects into larger structures, such as complex user interfaces or accounting data.
Behavioral patterns help you define the communication between objects in your system and how the flow is controlled in a complex program.
We’ll be looking at C# versions of these patterns.
Popularity: 3% [?]
January 4th, 2009
admin
Posted in
Tags: