120 likes | 287 Views
Patterns in Software Design. Objectives. To explain why design patterns are important To define software design patterns To present a taxonomy of design patterns based on their granularity To discuss pattern catalogs. Topics. Why design patterns are important Christopher Alexander
E N D
Objectives • To explain why design patterns are important • To define software design patterns • To present a taxonomy of design patterns based on their granularity • To discuss pattern catalogs
Topics • Why design patterns are important • Christopher Alexander • Software design patterns • Pattern granularity • Pattern catalogs
Why Design Patterns? • Expert designers behave differently from novices—what do experts know that novices do not? • Among other things, experts have a store of successful design patterns from past experience that they apply to new problems.
More Pattern Advantages • Promotingcommunication—Pattern names and knowledge of advantages and disadvantages speeds communication • Streamliningdocumentation—Pattern form and behavior need not be elaborated • Increasingefficiency—Tool support for patterns makes development faster • Supportingreuse—Patterns and their implementations can be reused extensively • Providingideas—Patterns can be the starting point for design or a basis for improvements
Design Patterns in Building Architecture • In the 1970s architect Christopher Alexander introduced a new approach to building design based on design patterns. • Alexander argued that • patterns are consequences of human anatomy, psychology, physiology, sociology, and politics; • great architecture has always relied on patterns, but they have never been studied systematically; and • anyone can make great buildings once the patterns are known and understood.
Examples of Alexander’s Patterns • Scattered Work—Use laws and incentives to encourage work places throughout a city. • Four-Story Limit—In an urban area, keep most buildings four stories high or less. • South Facing Outdoors—Always build structures north of the outdoor spaces that go with them. • Warm Colors—Choose light and surface colors to achieve a yellow-red light tone in a room.
Results of Alexander’s Work • Alexander’s work has not been widely accepted among building architects, and his efforts to get non-professionals to design great buildings have often failed, as he himself admits. • But Alexander has inspired a community of software developers to generate work in design patterns.
Design Patterns Defined A pattern is a model proposed for imitation. A software design pattern is a model proposed for imitation in solving a software design problem. The pattern community generally prefers a more complex definition of patterns involving context, resolved forces, etc.
Design Pattern Granularity Software design patterns have no inherent granularity. • Architectural styles or patterns are for entire systems and sub-systems. • Design patternsproper involve several interacting functions or classes. • Data structures &algorithms are low-level patterns. • Idioms are ways of doing things in particular programming languages.
Pattern Catalogs • Realization of the importance of design patterns has spurred creation of catalogs of patterns. • These are much like the pattern books used in building architecture or interior design and the handbooks used in engineering. • We will consider a small collection of patterns, presenting our own catalog.
Summary • Design patterns capture expertise and make it available to novices and experts, providing many advantages. • Design patterns are models propose for imitation in solving software design problems. • Patterns come in various granularities including architectural styles, mid-level design patterns, data structures and algorithms, and programming language idioms.