0% found this document useful (0 votes)
6 views9 pages

Design Pattern Summery

Uploaded by

Nour Rkien
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views9 pages

Design Pattern Summery

Uploaded by

Nour Rkien
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Creational Design Pattern:

FACTORY METHOD:

BUILDER:
Structural Design Patterns
Flyweight:
Flyweight is a structural design pattern that lets you fit more objects into the available amount of RAM by
sharing common parts of state between multiple objects instead of keeping all of the data in each object.

BRIDGE:

Bridge is a structural design pattern that lets you split a large class or a set of closely related classes into two
separate hierarchies—abstraction and implementation—which can be developed independently of each other.
COMPOSITE:

Composite is a structural design pattern that lets you compose objects into tree structures and then work with these
structures as if they were individual objects.

PROXY:

Proxy is a structural design pattern that lets you provide a substitute or placeholder for another object. A proxy
controls access to the original object, allowing you to perform something either before or after the request gets
through to the original object.
ADAPTER:

Adapter is a structural design pattern that allows objects with incompatible interfaces to collaborate.

FAÇADE:

Facade is a structural design pattern that provides a simplified interface to a library, a framework, or any other
complex set of classes.
Behavioral Design Patterns
ITERATOR:

pattern that lets you traverse elements of a collection without exposing its underlying representation (list, stack,
tree, etc.).

VISITOR:

Visitor is a behavioral design pattern that lets you separate algorithms from the objects on which they operate.
STRATEGY:

Strategy is a behavioral design pattern that lets you define a family of algorithms, put each of them into a separate
class, and make their objects interchangeable.

OBSERVER:

Also known as: Event-Subscriber, Listener. Observer is a behavioral design pattern that lets you define a subscription
mechanism to notify multiple objects about any events that happen to the object they’re observing.
MVC:
The Model represents the business layer of the application.

The View defines the presentation of the application , describes the state of the Model

The Controller acts on both model and view. It controls the data flow into model object and updates the view
whenever data changes. Controller decides what the model is to do, The Controller and the Model can always be
separated (what to do versus how to do)

Model is always independent from Controller and View, where both Controller and View can be combined in small
programs.

MVC OBSERVER:
An Observable is an object that can be observed Observable

• An Observer is notified when an object that it is observing announces a change

• When an Observable wants the world to know about what it has done, it executes:

- setChanged()
- notifyObserver()

The Observable doesn't know or care who is looking

• But you have attach an Observer to the Observable with: myObservable. addObserver(myObserver);

An Observer is an interface that implements:

public void update ( Observable obs, Object arg);

This method is invoked whenever an Observable that it is listening to does an notifyObservers([obs]) and the
Observable object called setChanged().

The obs argument is a reference to the observable object itself.

You might also like