70 likes | 83 Views
Learn about the need for classification of mid-level design patterns and explore the three categories in the scheme: Broker, Generator, and Reactor patterns.
E N D
Objectives • To propose a classification scheme to help remember patterns • To present the three categories in the scheme
Topics • The need for classification • Pattern categories
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.
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.
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).
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