Download presentation
Presentation is loading. Please wait.
Published bySheila Knight Modified over 9 years ago
1
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 Mid-Level Design Patterns Categories
2
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 2 Objectives To propose a classification scheme to help remember patterns To present the three categories in the scheme
3
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 3 Topics The need for classification Pattern categories
4
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 4 The Need for Classification Since their introduction in the mid-1990s, hundreds of mid-level design patterns have been published. How can designers keep them all in mind? Many are not that important or have narrow application. A pattern classification scheme can help designers remember many important patterns.
5
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 5 Pattern Categories Broker patterns have a client that needs a service from a supplier, and a broker that mediates the interaction between client and supplier. Generator patterns have a client who needs a new instance of a product, and a generator class that supplies the instance. Reactor patterns have a client that needs to respond to an event in a target. The client delegates this responsibility to a reactor.
6
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 6 Category Analogies Brokers are like stock brokers who mediate interactions between an investor (client) and the stock market (supplier). Generators are like interior designers who obtain material from manufacturers (products) on behalf of their clients. Reactors are like lawn service companies that respond to conditions in a lawn (target) on behalf of a homeowner (client).
7
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 7 Summary There are hundreds of design patterns and they are hard to remember. One way to help remember them is to classify them. Our pattern collection is classified into three categories: Broker patterns Generator patterns Reactor patterns
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.