Professional Documents
Culture Documents
Structural Design Patterns: Example: When A Person Traveling From Lahore To Islamabad He Need To
Structural Design Patterns: Example: When A Person Traveling From Lahore To Islamabad He Need To
Structural Design Patterns: Example: When A Person Traveling From Lahore To Islamabad He Need To
These design patterns are all about Class and Object composition. .
Adapter
Match interfaces of different classes
Bridge
Separates an object’s interface from its implementation
Example:
Composite
A tree structure of simple and composite objects
Example:
Menu items in GUI screens is the real time example of composite design
pattern.
Decorator
Add responsibilities to objects dynamically
Example:
I have a business .I want new product in my business. I no want to change
the architecture of existing .I change the design of the architecture for the
newly add product with affecting the existing.
Facade
A single class that represents an entire subsystem
Flyweight
A fine-grained instance used for efficient sharing
Example: Library have dedicated shelves with the newest and most
popular publication . this is a cache. First you can take a look at the
dedicated shelves for the book you are looking for, if not find then you
ask the librarian.
Example:
A person you cook a stew for her friends . he want to prevent your friends
from consuming the stew by tasting it while he is cooking, otherwise
there will be no more stew for dinner later
Proxy
An object representing another object
Example: A person use Facebook,he 1st register with the FB and the
log on each session.once logged on, he has access to your friend’s
pages. All action that perform originate on browsers .the object are FB
pages the proxies are the mechanisms that allow registration and log out.