View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Discussion 2 - Priyanka Mahalanabis

Part 1

What are the differences between creational, structural and behavioral patterns?

A design pattern is the solution to a common design problem. It can be detailed through class diagrams, code and even written descriptions. There are 23 design patterns covered in Design Patterns - Elements of Reusable Object Oriented Software by Gamma, Helm, Johnson and Vlissides. These 23 patterns are divided into three areas based on purpose: creational, structural and behavioral. "Creational patterns deal with object creation. Structural patterns relate to object composition and behavioral patterns deal with the interaction between objects" [Wegener].

Using creational patterns - one does not need to instantiate objects any more instead the objects are created for you. This creates flexibility in which objects will be created in the program. These patterns include - abstract factory, builder, factory method, prototype and singleton.

Structural patterns ease combining groups of objects into larger groups. They are implemented with user interfaces. Some structual patterns include - adapter, bridge, composite, decorator, facade, flyweight, proxy.

Behavioral patterns define how the object will relate to itself as well as other objects and its flow pattern. It may be based on "state, request handling and object interaction" [Wegener]. Examples of behavioral patterns include - chain of responsibility, command, interpreter, iterator, mediator, memento, observer, state, strategy, template method, and visitor.

Part 2

Describe an interesting pattern.

The observer pattern is a listener of one or more objects. If a change occurs in one of the objects it notifies all dependents of that object change. There is a subscribe and unsubscribe method for adding and removing listeners from objects. This pattern definitely sounds useful and a pattern that I would likely implement. In large scale programs - a number of objects may call on other objects and for the programmer the list of who-calls-who may skip over some objects. This pattern would alleviate that stress and ensure that all objects are notified of appropriate changes.


Architecture Design: Design Patterns
Article by Robert Wegener:
What are Design Patterns
Article by James W. Cooper
Observer Pattern
Wikipedia Article:

Link to this Page