Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007
Junior, Computer Science
I spent 1 year at the University of Texas at Arlington, and transfered to this school last Fall.
Since I was mainly studying Math before I came here, this semester is my second year as a CS Major.
Part(1)...What are the differences between creational, structural, and behavioral patterns?
The authors of the book titled "Design Patterns: Elements of Reusable Software" divided 23 design patterns into
three types: creational, structural, and behavioral.
This design pattern is all about class instantiation and deals with the best way to create instances of objects.
This pattern automatically creates objects for you even if you don't instantiate objects directly.
For example, in java, you usually create an instances of an object by using 'new' operator.
Student bob = new Student();
This means that you are simply hard coding how you create the object within your program. However, sometimes abstracting the creation of objects into a special "object creator" class can give your program more flexibility in deciding which objects need to be created for a given case.
Finally, this pattern can be further divided into five types:AbstractFactory Pattern,Builder Pattern,FactoryMethod Pattern,Prototype Pattern,and Singleton Pattern.
(Summary of these patterns can be found at http://c2.com/cgi-bin/wiki?CategoryCreationalPatterns)
Behavioral patterns are concerned with algorithms and the assignment of responsibilities between objects. It also helps us define the patterns of communication between objects and classes.
Behavioral patterns usually involve only single classes or a single family of classes.
This pattern can be further divided into twelve types according to the Design Patterns book. Among these twelve patterns, the most commonly used are State, Command, Strategy, and Iterator Patterns.
(Summary of these patterns can be found at http://c2.com/cgi-bin/wiki?CategoryBehavioralPatterns)
Structural Patterns are concerned about how groups of classes are composed to form larger structures.
It helps us change some aspects of system structure independently of other aspects.
(Structural Patterns based on class use inheritance to compose interfaces or implementations.
Structural Patterns that target objects use object composition to add new functionality.)
In addition, this pattern also helps us make a system more robust to a paticular kind of structural change.
Among Structural Patterns, the most commonly used are adapter, bridge, composite, facade,and proxy patterns.
(Summary of these patterns can be found at http://c2.com/cgi-bin/wiki?CategoryStructuralPatterns)
Links to this Page