Structural Design Patterns Introduction04:33

  • 0
Published on November 29, 2017

In this video we will discuss
1. Introduction to Structural Design Patterns
2. Types of Structural Design Patterns

Introduction to Structural Design Patterns : In the previous sessions we have discussed and understood the creational design patterns in detail. We have also learnt which design pattern needs to be applied based on the project requirements.

Definition : “Structural Design Patterns are Design Patterns that ease the design by identifying a simple way to realize relationships between entities”

• Structural patterns define how each component or entity should be structured so as to have very flexible interconnecting modules which can work together in a larger system.
• A structural design pattern also describes how data moves through the pattern.
• Structural patterns describe how classes and objects can be combined to form larger structures
• These patterns describe how objects can be composed into larger structures using object composition, or the inclusion of objects within other objects

Gang of four has defined 7 Structural Design Patterns
• Adapter
• Bridge
• Composite
• Decorator
• Facade
• Flyweight
• Proxy

Adapter : Match interfaces of different classes
• An adapter allows two incompatible interfaces to work together.
• The Adapter design pattern allows incompatible classes to interact with each other by converting the interface of one class into an interface expected by the clients.
• Leveraging on Adapter pattern Improves reusability of older functionality.

Bridge : Separates an object’s interface from its implementation
• To Simplify this definition, The bridge pattern uses encapsulation, aggregation, and can use inheritance to separate responsibilities into different classes.
• It Decouples an abstraction from its implementation so that decoupling and abstraction can vary independently”.
• The bridge pattern can also be thought of as two layers of abstraction.
• The Bridge pattern is use full when we want to avoid a permanent binding between an abstraction and its implementation.
• Bridge Patterns enables us to separate the interface from the implementation and Improves extensibility.
• Also, it hides implementation details from clients.

Composite : A tree structure of simple and composite objects
• In object-oriented programming, a composite is an object designed as a composition of one-or-more similar objects, all exhibiting similar functionality.
• The Composite pattern enables us to create hierarchical tree structures of varying complexity, while allowing every element in the structure to operate with a uniform interface.
• The composite pattern describes that a group of objects are to be treated in the same way as a single instance of an object.
• The intent of a composite is to “compose” objects into tree structures to represent part-whole hierarchies. Implementing the composite pattern lets clients treat individual objects and compositions uniformly.

Decorator : Add responsibilities to objects dynamically
• To simplify this, The Decorator pattern enables us to add or remove object functionality without changing the external appearance or function of the object.
• The Decorator pattern attaches additional responsibilities to an object dynamically to provide a flexible alternative to changing object functionality without using static inheritance.

Facade : A single class that represents an entire subsystem
• The Facade pattern provides a unified interface to a group of interfaces in a subsystem.
• The Facade pattern defines a higher-level interface that makes the subsystem easier to use with only one single interface.
• This unified interface enables an object to access the subsystem using the interface to communicate with the subsystem.
• Reduces coupling between subsystems provided if every subsystem uses its own facade pattern and other parts of the system use the facade pattern to communicate with the subsystem.
• Façade pattern Shields clients from subsystem components.

Flyweight : A fine-grained instance used for efficient sharing
• The Flyweight pattern reduces the number of low-level, detailed objects within a system by sharing objects.
• The Flyweight pattern defines a structure for sharing objects and focuses its capabilities for space efficiency.

Text version of the video

Slides

Design Patterns Tutorial playlist

Design Patterns Text articles and slides

All Dot Net and SQL Server Tutorials in English

All Dot Net and SQL Server Tutorials in Arabic

Enjoyed this video?
"No Thanks. Please Close This Box!"