Download presentation
Presentation is loading. Please wait.
Published byDebra Watson Modified over 9 years ago
1
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 Patterns in Software Design
2
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 2 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
3
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 3 Topics Why design patterns are important Christopher Alexander Software design patterns Pattern granularity Pattern catalogs
4
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 4 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.
5
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 5 More Pattern Advantages Promoting communication—Pattern names and knowledge of advantages and disadvantages speeds communication Streamlining documentation—Pattern form and behavior need not be elaborated Increasing efficiency—Tool support for patterns makes development faster Supporting reuse—Patterns and their implementations can be reused extensively Providing ideas—Patterns can be the starting point for design or a basis for improvements
6
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 6 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.
7
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 7 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.
8
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 8 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.
9
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 9 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.
10
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 10 Design Pattern Granularity Software design patterns have no inherent granularity. Architectural styles or patterns are for entire systems and sub-systems. Design patterns proper involve several interacting functions or classes. Data structures & algorithms are low-level patterns. Idioms are ways of doing things in particular programming languages.
11
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 11 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.
12
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 12 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.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.