chicago information technology architects group - design patterns
DESCRIPTION
TRANSCRIPT
www.psclistens.com
Design Patterns in Java and .NET
Tim MurphyTechnical Specialist
Mike VogtVice President of Architecture
Objective• Show the usefulness of Design Patterns
when developing applications and how they apply no matter what the platform.
Agenda• History of patterns• What are patterns• Why are patterns important• Explore 6 common patterns• Anti-Patterns
History Of Patterns• Gang Of Four• POSA – Patterns of
Software Architecture• Patterns of Enterprise
Application Architecture
What Are Patterns
• Pattern Name• Problem• Solution• Consequences
Why Are Patterns Important• Common vocabulary• Repositories of common solutions
Factory Method Pattern• Method for object creation• Lets subclasses decide which classes
to create
Decorator Pattern
• Attach additional responsibilities to an object dynamically
• Allows behavior to be added via “wrappers”
• Avoids extensive inheritance hierarchies
cost()
Whip
cost()
Mocha
cost()DarkRoast
Adapter Pattern• Allows a system to use methods that
do not match their interface
Visitor Pattern• A way of separating an algorithm from
an object structure it operates on.• One can add new operations to
existing object structures without modifying those structures<<interface>>
CarElement
+ accept(CarElementVisitor v)
Wheel Engine Body Car
Strategy Pattern• Interchangeable algorithms
Composite Pattern• Allows you to compose objects into
tree structures to represent whole-part hierarchies.
• Lets clients treat individual objects and compositions of objects uniformly.
Node
Leaf Leaf Leaf
<<interface>>Component
+ operation+ add(Component c)+ remove(Component c)+ getChild(int i)
Leaf
+ operation()
Composite
add, remove, getChild, operation
Client
Anit-Patterns• One pattern to rule them all• Loosey Goosey
ResourcesDesign Patterns: Elements of Reusable Object-Oriented Software – Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides
Head First Design Patterns – Eric Freeman and Elisabeth Freeman
Design Patterns In C# - Steven John Metsker
Thank You!Blogs –
geekswithblogs.net/tmurphy
Email [email protected]@psclistens.com
Twitter –@twmurph@mvogt99
PSC’s websitewww.psclistens.com