Structural Patterns (v1)

Structural Patterns (v1) - Object-Oriented Desgin...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Object-Oriented Desgin Structural Patterns George Blankenship 1 Structural Patterns George Blankenship 1 CSCI 253 Object Oriented Design: Structural Patterns George Blankenship Structural Patterns George Blankenship 2 Overview Creational Patterns Singleton Abstract factory Factory Method Prototype Builder Structural Patterns Composite Faade Proxy Flyweight Adapter Bridge Decorator Behavioral Patterns Chain of Respons. Command Interpreter Iterator Mediator Memento Observer State Strategy Template Method Visitor Structural Patterns George Blankenship 3 Structural Patterns The Adapter pattern, used to change the interface of one class to that of another one. The Bridge pattern, intended to keep the interface to your client program constant while allowing you to change the actual kind of class you display or use. You can then change the interface and the underlying class separately. The Composite pattern, a collection of objects, any one of which may be either itself a Composite, or just a primitive object. The Decorator pattern, a class that surrounds a given class, adds new capabilities to it, and passes all the unchanged methods to the underlying class. The Faade pattern, which groups a complex object hierarchy and provides a new, simpler interface to access those data. The Flyweight pattern, which provides a way to limit the proliferation of small, similar class instances by moving some of the class data outside the class and passing it in during various execution methods. The Proxy pattern, which provides a simple place-holder class for a more complex class which is expensive to instantiate. Object-Oriented Desgin Structural Patterns George Blankenship 2 Structural Patterns George Blankenship 4 The Adapter Pattern: The Problem Provide an Interface for to remap the interface of an existing class to expected interface of another existing class- Linked List each object is a list entry (extends ListEntry)- List of objects none of the object are required to extend LinkEntry Also known as : Wrapper Linked List List of Objects Structural Patterns George Blankenship 5 Motivation Sometimes a toolkit or class library can not be used because its interface is incompatible with the interface required by an application We can not change the library interface, since we may not have its source code Even if we did have the source code, we probably should not change the library for each domain-specific application Structural Patterns George Blankenship 6 Link List Two classes to create and maintain linked lists ListHead (control object for a linked list) ListEntry (entries that can be placed on list) Objects that extend ListEntry can be placed on any linked list Objects that do not, cannot Should all classes extend LinkList?...
View Full Document

This note was uploaded on 09/03/2010 for the course CSC 253 taught by Professor Georgeblankenship during the Spring '10 term at GWU.

Page1 / 34

Structural Patterns (v1) - Object-Oriented Desgin...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online