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

The Real Discussion 2 - Michael Levy

Design Patterns


Creational, Structural, and Behavioral Patterns
http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29
http://en.wikipedia.org/wiki/Creational_pattern
http://en.wikipedia.org/wiki/Structural_pattern
http://en.wikipedia.org/wiki/Behavioral_pattern


Part 1



Design patterns, as descibed in Wikipedia, are general solutions to a common problem when designing software. They are pieces of unfinished code that can be applied to multiple software design problems. Design patterns are grouped into many categories, of which three of them are structural, creational, and behavioral.

Creational design patterns deal with object creation and trying to make sure that objects are created in a way that is suitable to the situation. When creating objects, the basic method has the potential of resulting in design problems or unwanted complexity. Creational design patterns solve this problem by making object creation more flexible.

Structural design patterns provide an easy way to find a simple way to realize relationships between entities, thereby making the design itself easier.

Behavioral design patterns finds, recognizes, and identifies the common communication patterns between objects. The benefit of this is that these patterns make software more flexible in the communication between the objects.

Part 2


http://en.wikipedia.org/wiki/Event_listener


An example of one design pattern is an event listener. It is designed to distribute data to objects that want to receive the data. However, it doesn't keep a record of where this data should go, especially if the record should need to change over the course of the running program. All that is needed is a way to setup a registration method, and then keep a running tab of everything that is interested and then send the data, whenever it arrives to the interested objects. This makes perfect sense to me and I can see multiple ways of using this in my code. The most predominant being handling user events such as mouse clicks or key presses.


Link to this Page