View this PageEdit this Page (locked)Attachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Discussion 2 - Fisnik Shpuza

How do design patterns and a pattern languages differ? What is the use of each?

In software engineering, a design pattern is a general solution to a common problem in software design. A design pattern isn't a finished design that can be transformed directly into code; it is a description or template for how to solve a problem that can be used in many different situations [Wikipedia]. In general design patterns are considered as an abstracted class diagram. A pattern language is a structured method of describing good design practices within a particular domain. It is characterized by
Noticing and naming the common problems in a field of interest,
Describing the most effective solutions for meeting some stated goal,
Helping the designer move from problem to problem in a logical way, and
Allowing for many different paths through the design process.
The origin of design patterns lies in work done by an architect named Christopher Alexander during the late 1970s. He began by writing two books, A Pattern Language[Alex77] and A Timeless Way of Building [Alex79] which, in addition to giving examples, described his rationalle for documenting patterns.
To be mentioned here are the Gang of Four (GOF) generally considered the foundations of all patterns and categorized in 3 groups. Creational, Structural and Behavioral Design Patterns

Design Patterns.
Design patterns deal more the interaction of the the objects, as well as providing a communication platform concerning elegant and reusable solutions to commonly encountered programming challenges. The [GoF] book defines design patterns as "descriptions of communicating objects and classes that are customized to solve a general design problem in a particular context." It then goes on to say that:

A design pattern names, abstracts, and identifies the key aspects of a common design structure that make it useful for creating a reusable object-oriented design. The design pattern identifies the participating classes and their instances, their roles and collaborations, and the distribution of responsibilities. Each design pattern focuses on a particular object-oriented design problem or issue. It describes when it applies, whether or not in can be applied in view of other design constraints, and the consequences and trade-offs of its use. Since we must eventually implement our designs, a design pattern also provides sample ... code to illustrate an implementation. Although design patterns describe object-oriented designs, they are based on practical solutions that have been implemented in mainstream object-oriented programming languages ....
Clearly this definition has a lateral view of design patterns aiming more towards object oriented design, but as suggested by the above reference , by simply removing the words object oriented and replace class with module this definition could have a more universal consideration.

Pattern Languages.
A collection of patterns forms a vocabulary for understanding and communicating ideas. The creation of this vocabulary facilitates the use of a common language. Such a collection or language may be put together into a cohesive "whole" that reveals the inherent structures and relationships of its constituent parts toward fulfilling a shared objective. This is what Alexander calls a pattern language. If a pattern is a recurring solution to a problem in a context given by some forces, then a pattern language is a collective of such solutions which, at every level of scale, work together to resolve a complex problem into an orderly solution according to a pre-defined goal. []
In the Patterns Definitions section of the Patterns Home Page, Cope defines a pattern language as follows:
A pattern language defines a collection of patterns and the rules to combine them into an architectural style. Pattern languages describe software frameworks or families of related systems
Does it make sense to you? Can you see using it in your coding? If so, what for?

The use and creation of patterns is a must for the software engineering world. From previous classes I have learned that only a small part, about 12% of all major software development projects satisfy client requirements, and only 4% have no major bugs or require liquid maintenance.
My interests as a possible future software engineer include the use of these common patterns from proven successful solutions avoiding the "reinvention of the wheel" while trying to find an optimal solution for a given problem.
I see the use of a common language or patterns as significant step to approach, identify and solve problems in software engineering in a modern scientific mode, rather than in a "do it your self" manner. One such example that I use often in my code is to see possible other solutions, compare them and see the common trend that others, faced with a similar problem, have used. Besides that, code reuse and program design reference of my own work are helpful if I follow design patterns correctly.

Link to this Page