• Embed Doc
  • Readcast
  • Collections
  • CommentGo Back
Download
 
Pattern Languages of Programming
design pattern
is a general reusable solution to a commonlyoccurring problem insoftware design. A design pattern is not a finished design that can be transformed directly intocode.It is a description or template for how to solve a  problem that can be used in many different situations.Object-orienteddesign patternstypically show relationships andinteractionsbetweenclasses or objects,without specifying the final application classes or objects that are involved.Algorithmsare notthought of as design patterns, since they solve computational  problems rather than design   problems. Not all software patterns are design patterns. Design patterns deal specifically with problems at the level of software
design
. Other kinds of patterns, such asarchitectural patterns, describe problems and solutions that have alternative scopes.
History
Patterns originated as anarchitectural conceptbyChristopher Alexander (1977/79). In 1987,Kent Beck and Ward Cunninghambegan experimenting with the idea of applying  patterns to programmingand presented their results at the OOPSLA conference that year.
 In the following years, Beck, Cunningham and others followed up on this work.Design patterns gained popularity in computer science after the book 
was published in 1994 (Gamma et al.).That same year, the firstPattern Languages of ProgrammingConference was held and thefollowing year, the Portland Pattern Repositorywas set up for documentation of design  patterns. The scope of the term remains a matter of dispute. Notable books in the design pattern genre include:
(2002). Patterns of Enterprise Application Architecture. 
.
.
;
 ,
 , and 
.
.
.
.
Although the practical application of design patterns is a phenomenon, formalization of the concept of a design pattern languished for several years.
Practice
 
Design patterns can speed up the development process by providing tested, provendevelopment paradigms. Effective software design requires considering issues that maynot become visible until later in the implementation. Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readabilityfor coders and architects who are familiar with the patterns.In order to achieve flexibility, design patterns usually introduce additional levels of indirection, which in some cases may complicate the resulting designs and hurtapplication performance.By definition, a pattern must be programmed anew into each application that uses it.Since some authors see this as a step backward from software reuse as provided by components, researchers have worked to turn patterns into components. Meyer andArnout claim a two-thirds success rate in componentizing the best-known patterns.
Often, people only understand how to apply certain software design techniques to certain problems. These techniques are difficult to apply to a broader range of problems. Design patterns provide general solutions,documentedin a format that doesn't require specificstied to a particular problem.
Structure
Design patterns are composed of several sections (seeDocumentation  below). Of   particular interest are the Structure, Participants, and Collaboration sections. Thesesections describe a
design motif 
: a prototypical
micro-architecture
that developers copyand adapt to their particular designs to solve the recurrent problem described by thedesign pattern. A micro-architecture is a set of program constituents (e.g., classes,methods...) and their relationships. Developers use the design pattern by introducing intheir designs this prototypical micro-architecture, which means that micro-architecturesin their designs will have structure and organization similar to the chosen design motif.In addition, patterns allow developers to communicate using well-known, wellunderstood names for software interactions. Common design patterns can be improvedover time, making them more robust than
ad-hoc
designs.
 
] Domain specific patterns
Efforts have also been made to codify design patterns in particular domains, includinguse of existing design patterns as well as domain specific design patterns. Examplesinclude User Interface design patterns,
[5]
, Secure Usability
and web design.
ThePattern Languages of ProgrammingConference (annual, 1994—) proceedings  includes many examples of domain specific patterns.
Classification
Design patternswere originally grouped into the categoriesCreational patterns, Structural 
 
 patterns, and Behavioral patterns, and described them using the concepts of delegation, aggregation, andconsultation. For further background on object-oriented design, see couplingand cohesion. For further background on object-oriented programming, see inheritance, interface,and  polymorphism. Another classification has also introduced the notion of architectural design pattern which may be applied at the architecture level of the software such as theModel-View-Controller pattern.
Name DescriptionIn 
In
Abstract factoryProvide an interface for creating families of related or dependent objects without specifyingtheir concrete classes.
 
YesYesFactory methodDefine an interface for creating an object, butlet subclasses decide which class to instantiate.Factory Method lets a class defer instantiationto subclasses.YesYesBuilder Separate the construction of a complex objectfrom its representation so that the sameconstruction process can create differentrepresentations.YesNoLazyinitializationTactic of delaying the creation of an object, thecalculation of a value, or some other expensive process until the first time it is needed. NoNoObject poolAvoid expensive acquisition and release of resources by recycling objects that are no longer in use NoNoPrototypeSpecify the kinds of objects to create using a prototypical instance, and create new objects bycopying this prototype.YesNoSingletonEnsure a class has only one instance, and provide a global point of access to it.YesYesResourceacquisition isinitializationEnsure that resources are properly released bytying them to the lifespan of suitable objects. NoNo
Adapter Convert the interface of a class into another interface clients expect. Adapter lets classeswork together that couldn't otherwise because of incompatible interfaces.YesYesBridgeDecouple an abstraction from itsimplementation so that the two can varyindependently.YesYesCompositeCompose objects into tree structures torepresent part-whole hierarchies. Composite letsYesYes
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
You must be to leave a comment.
Submit
Characters: ...