SlideShare a Scribd company logo
Design Patterns Shailesh Kumar S
Agenda Structural Design Patterns: Adapter Decorator Bridge Facade
Structural Patterns What? Defines composition between entities to build larger systems. Why? Helps in understanding the relationship between classes and objects. How? By using following Patterns: Adapter, Facade, Bridge, Decorator, etc.
Adapter Pattern What? Translate one interface of a class into a compatible interface. Why? And old legacy class needs to be reused, but its interface is different than application expects .
Example 1: Example 2:
Decorator Pattern What? Defines attaching new responsibility to the object dynamically. Why? Helps in wrapping an existing object with another object with out breaking the interface or other objects.
Example 1: Example 2:
Bridge Pattern What? Separates objects interface and its implementation. Why? Both abstraction and implementation can vary independently. Avoiding hard binding between abstraction and implementation. Reduce number of sub classes and this reduction in code size.
Example:  House electrical equipment and switch Text file storage and representation across operating systems.
Facade Pattern What? An Higher level interface to a complex sub-system to simplify communication. Why? Re-structuring a complex system into less complex sub-systems Reduce dependencies between sub-systems .
Example: Client Object 1 Client Object 2 Client objects Sub-systems objects Ordering  System Billing System Query System Client Object 3
With Facade Pattern: Example:  Customer Service Support system Library Management system Client objects Sub-system objects Facade Client Object 2 Client Object 1 Client Object 3 Billing System Ordering  System
When to choose what: Adapter:  You want to use an existing class, and its interface does not match the one you need. Decorator: When you want to enhance the responsibilities of an object. When extension for an object via sub-classing is complex/tedious. Bridge: Only applied before the classes are designed. When both side of the interfaces can vary independently.
Facade: When you want to define new interface for a group of objects with out adding new functionality. When you want to represent 1 object for a group of objects to simplify communication.
Questions?
Ad

More Related Content

What's hot (10)

Facade pattern
Facade patternFacade pattern
Facade pattern
JAINIK PATEL
 
Communication Diagram
Communication DiagramCommunication Diagram
Communication Diagram
University of Texas at Dallas
 
My Sql Work Bench
My Sql Work BenchMy Sql Work Bench
My Sql Work Bench
Lahiru Danushka
 
Object diagram
Object diagramObject diagram
Object diagram
University of Texas at Dallas
 
Axis2, middleware for next generation web services
Axis2, middleware for next generation web servicesAxis2, middleware for next generation web services
Axis2, middleware for next generation web services
Srinath Perera
 
DSC - Shared Preferences and Room
DSC - Shared Preferences and RoomDSC - Shared Preferences and Room
DSC - Shared Preferences and Room
Agustinus Theodorus
 
Modern databases and its challenges (SQL ,NoSQL, NewSQL)
Modern databases and its challenges (SQL ,NoSQL, NewSQL)Modern databases and its challenges (SQL ,NoSQL, NewSQL)
Modern databases and its challenges (SQL ,NoSQL, NewSQL)
Mohamed Galal
 
مقدمة عن NoSQL بالعربي
مقدمة عن NoSQL بالعربيمقدمة عن NoSQL بالعربي
مقدمة عن NoSQL بالعربي
Mohamed Galal
 
Exploiting Web Technologies to connect business process management and engine...
Exploiting Web Technologies to connect business process management and engine...Exploiting Web Technologies to connect business process management and engine...
Exploiting Web Technologies to connect business process management and engine...
Stefano Costanzo
 
Communication diagram Introduction
Communication diagram IntroductionCommunication diagram Introduction
Communication diagram Introduction
Dineesha Suraweera
 
Axis2, middleware for next generation web services
Axis2, middleware for next generation web servicesAxis2, middleware for next generation web services
Axis2, middleware for next generation web services
Srinath Perera
 
DSC - Shared Preferences and Room
DSC - Shared Preferences and RoomDSC - Shared Preferences and Room
DSC - Shared Preferences and Room
Agustinus Theodorus
 
Modern databases and its challenges (SQL ,NoSQL, NewSQL)
Modern databases and its challenges (SQL ,NoSQL, NewSQL)Modern databases and its challenges (SQL ,NoSQL, NewSQL)
Modern databases and its challenges (SQL ,NoSQL, NewSQL)
Mohamed Galal
 
مقدمة عن NoSQL بالعربي
مقدمة عن NoSQL بالعربيمقدمة عن NoSQL بالعربي
مقدمة عن NoSQL بالعربي
Mohamed Galal
 
Exploiting Web Technologies to connect business process management and engine...
Exploiting Web Technologies to connect business process management and engine...Exploiting Web Technologies to connect business process management and engine...
Exploiting Web Technologies to connect business process management and engine...
Stefano Costanzo
 
Communication diagram Introduction
Communication diagram IntroductionCommunication diagram Introduction
Communication diagram Introduction
Dineesha Suraweera
 

Similar to My design patterns (20)

Encapsulation
EncapsulationEncapsulation
Encapsulation
FALLEE31188
 
Software Architecture and Project Management module III : PATTERN OF ENTERPRISE
Software Architecture and Project Management module III : PATTERN OF ENTERPRISESoftware Architecture and Project Management module III : PATTERN OF ENTERPRISE
Software Architecture and Project Management module III : PATTERN OF ENTERPRISE
sreeja_rajesh
 
Third AssignmentDescribe in 100 – 200 words an application with .docx
Third AssignmentDescribe in 100 – 200 words an application with .docxThird AssignmentDescribe in 100 – 200 words an application with .docx
Third AssignmentDescribe in 100 – 200 words an application with .docx
randymartin91030
 
Architecture and design
Architecture and designArchitecture and design
Architecture and design
himanshu_airon
 
Nina Grantcharova - Approach to Separation of Concerns via Design Patterns
Nina Grantcharova - Approach to Separation of Concerns via Design PatternsNina Grantcharova - Approach to Separation of Concerns via Design Patterns
Nina Grantcharova - Approach to Separation of Concerns via Design Patterns
iasaglobal
 
Software Patterns
Software PatternsSoftware Patterns
Software Patterns
bonej010
 
Sda 9
Sda   9Sda   9
Sda 9
AmberMughal5
 
CS8592 Object Oriented Analysis & Design - UNIT II
CS8592 Object Oriented Analysis & Design - UNIT IICS8592 Object Oriented Analysis & Design - UNIT II
CS8592 Object Oriented Analysis & Design - UNIT II
pkaviya
 
Design Patterns - 01 Introduction and Decorator Pattern
Design Patterns - 01 Introduction and Decorator PatternDesign Patterns - 01 Introduction and Decorator Pattern
Design Patterns - 01 Introduction and Decorator Pattern
eprafulla
 
Object oriented analysis and design unit- iv
Object oriented analysis and design unit- ivObject oriented analysis and design unit- iv
Object oriented analysis and design unit- iv
Shri Shankaracharya College, Bhilai,Junwani
 
Unit-3.doc
Unit-3.docUnit-3.doc
Unit-3.doc
chitranshidheeraj6
 
Advanced Structural Modeling
Advanced Structural ModelingAdvanced Structural Modeling
Advanced Structural Modeling
AMITJain879
 
New phase ii-2010
New  phase ii-2010New  phase ii-2010
New phase ii-2010
vijet
 
Structural Design pattern - Adapter
Structural Design pattern - AdapterStructural Design pattern - Adapter
Structural Design pattern - Adapter
Manoj Kumar
 
Layered architecture style
Layered architecture styleLayered architecture style
Layered architecture style
Begench Suhanov
 
Software Testing and UML Lab
Software Testing and UML LabSoftware Testing and UML Lab
Software Testing and UML Lab
Harsh Kishore Mishra
 
Design patterns
Design patternsDesign patterns
Design patterns
Vignesh Nethaji
 
5.Software Design.ppt
5.Software Design.ppt5.Software Design.ppt
5.Software Design.ppt
ssuser1288e7
 
Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented Design
Aravinth NSP
 
Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented Design
Sudarsun Santhiappan
 
Software Architecture and Project Management module III : PATTERN OF ENTERPRISE
Software Architecture and Project Management module III : PATTERN OF ENTERPRISESoftware Architecture and Project Management module III : PATTERN OF ENTERPRISE
Software Architecture and Project Management module III : PATTERN OF ENTERPRISE
sreeja_rajesh
 
Third AssignmentDescribe in 100 – 200 words an application with .docx
Third AssignmentDescribe in 100 – 200 words an application with .docxThird AssignmentDescribe in 100 – 200 words an application with .docx
Third AssignmentDescribe in 100 – 200 words an application with .docx
randymartin91030
 
Architecture and design
Architecture and designArchitecture and design
Architecture and design
himanshu_airon
 
Nina Grantcharova - Approach to Separation of Concerns via Design Patterns
Nina Grantcharova - Approach to Separation of Concerns via Design PatternsNina Grantcharova - Approach to Separation of Concerns via Design Patterns
Nina Grantcharova - Approach to Separation of Concerns via Design Patterns
iasaglobal
 
Software Patterns
Software PatternsSoftware Patterns
Software Patterns
bonej010
 
CS8592 Object Oriented Analysis & Design - UNIT II
CS8592 Object Oriented Analysis & Design - UNIT IICS8592 Object Oriented Analysis & Design - UNIT II
CS8592 Object Oriented Analysis & Design - UNIT II
pkaviya
 
Design Patterns - 01 Introduction and Decorator Pattern
Design Patterns - 01 Introduction and Decorator PatternDesign Patterns - 01 Introduction and Decorator Pattern
Design Patterns - 01 Introduction and Decorator Pattern
eprafulla
 
Advanced Structural Modeling
Advanced Structural ModelingAdvanced Structural Modeling
Advanced Structural Modeling
AMITJain879
 
New phase ii-2010
New  phase ii-2010New  phase ii-2010
New phase ii-2010
vijet
 
Structural Design pattern - Adapter
Structural Design pattern - AdapterStructural Design pattern - Adapter
Structural Design pattern - Adapter
Manoj Kumar
 
Layered architecture style
Layered architecture styleLayered architecture style
Layered architecture style
Begench Suhanov
 
5.Software Design.ppt
5.Software Design.ppt5.Software Design.ppt
5.Software Design.ppt
ssuser1288e7
 
Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented Design
Aravinth NSP
 
Ad

Recently uploaded (20)

The fundamental misunderstanding in Team Topologies
The fundamental misunderstanding in Team TopologiesThe fundamental misunderstanding in Team Topologies
The fundamental misunderstanding in Team Topologies
Patricia Aas
 
Is Your QA Team Still Working in Silos? Here's What to Do.
Is Your QA Team Still Working in Silos? Here's What to Do.Is Your QA Team Still Working in Silos? Here's What to Do.
Is Your QA Team Still Working in Silos? Here's What to Do.
marketing943205
 
Outcome Over Output: How UXers Can Leverage an Outcome-Based Mindset by Malin...
Outcome Over Output: How UXers Can Leverage an Outcome-Based Mindset by Malin...Outcome Over Output: How UXers Can Leverage an Outcome-Based Mindset by Malin...
Outcome Over Output: How UXers Can Leverage an Outcome-Based Mindset by Malin...
UXPA Boston
 
Storage Setup for LINSTOR/DRBD/CloudStack
Storage Setup for LINSTOR/DRBD/CloudStackStorage Setup for LINSTOR/DRBD/CloudStack
Storage Setup for LINSTOR/DRBD/CloudStack
ShapeBlue
 
Reducing Bugs With Static Code Analysis php tek 2025
Reducing Bugs With Static Code Analysis php tek 2025Reducing Bugs With Static Code Analysis php tek 2025
Reducing Bugs With Static Code Analysis php tek 2025
Scott Keck-Warren
 
AI needs Hybrid Cloud - TEC conference 2025.pptx
AI needs Hybrid Cloud - TEC conference 2025.pptxAI needs Hybrid Cloud - TEC conference 2025.pptx
AI needs Hybrid Cloud - TEC conference 2025.pptx
Shikha Srivastava
 
UX for Data Engineers and Analysts-Designing User-Friendly Dashboards for Non...
UX for Data Engineers and Analysts-Designing User-Friendly Dashboards for Non...UX for Data Engineers and Analysts-Designing User-Friendly Dashboards for Non...
UX for Data Engineers and Analysts-Designing User-Friendly Dashboards for Non...
UXPA Boston
 
Stretching CloudStack over multiple datacenters
Stretching CloudStack over multiple datacentersStretching CloudStack over multiple datacenters
Stretching CloudStack over multiple datacenters
ShapeBlue
 
Breaking it Down: Microservices Architecture for PHP Developers
Breaking it Down: Microservices Architecture for PHP DevelopersBreaking it Down: Microservices Architecture for PHP Developers
Breaking it Down: Microservices Architecture for PHP Developers
pmeth1
 
How to Integrate FME with Databricks (and Why You’ll Want To)
How to Integrate FME with Databricks (and Why You’ll Want To)How to Integrate FME with Databricks (and Why You’ll Want To)
How to Integrate FME with Databricks (and Why You’ll Want To)
Safe Software
 
Apache CloudStack 101 - Introduction, What’s New and What’s Coming
Apache CloudStack 101 - Introduction, What’s New and What’s ComingApache CloudStack 101 - Introduction, What’s New and What’s Coming
Apache CloudStack 101 - Introduction, What’s New and What’s Coming
ShapeBlue
 
Building the plane as it flies through a black hole: revising five UX researc...
Building the plane as it flies through a black hole: revising five UX researc...Building the plane as it flies through a black hole: revising five UX researc...
Building the plane as it flies through a black hole: revising five UX researc...
UXPA Boston
 
GraphSummit Singapore Master Deck - May 20, 2025
GraphSummit Singapore Master Deck - May 20, 2025GraphSummit Singapore Master Deck - May 20, 2025
GraphSummit Singapore Master Deck - May 20, 2025
Neo4j
 
Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)
Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)
Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)
HusseinMalikMammadli
 
Managing Geospatial Open Data Serverlessly [AWS Community Day CH 2025]
Managing Geospatial Open Data Serverlessly [AWS Community Day CH 2025]Managing Geospatial Open Data Serverlessly [AWS Community Day CH 2025]
Managing Geospatial Open Data Serverlessly [AWS Community Day CH 2025]
Chris Bingham
 
Planetek Italia Corporate Profile Brochure
Planetek Italia Corporate Profile BrochurePlanetek Italia Corporate Profile Brochure
Planetek Italia Corporate Profile Brochure
Planetek Italia Srl
 
AI-Powered Prototyping: Building an Onboarding Flow with Cursor by Ivana Milicic
AI-Powered Prototyping: Building an Onboarding Flow with Cursor by Ivana MilicicAI-Powered Prototyping: Building an Onboarding Flow with Cursor by Ivana Milicic
AI-Powered Prototyping: Building an Onboarding Flow with Cursor by Ivana Milicic
UXPA Boston
 
Building Connected Agents: An Overview of Google's ADK and A2A Protocol
Building Connected Agents:  An Overview of Google's ADK and A2A ProtocolBuilding Connected Agents:  An Overview of Google's ADK and A2A Protocol
Building Connected Agents: An Overview of Google's ADK and A2A Protocol
Suresh Peiris
 
UX Change Fatigue: Building Resilient Teams in Times of Transformation by Mal...
UX Change Fatigue: Building Resilient Teams in Times of Transformation by Mal...UX Change Fatigue: Building Resilient Teams in Times of Transformation by Mal...
UX Change Fatigue: Building Resilient Teams in Times of Transformation by Mal...
UXPA Boston
 
Automating Call Centers with AI Agents_ Achieving Sub-700ms Latency.docx
Automating Call Centers with AI Agents_ Achieving Sub-700ms Latency.docxAutomating Call Centers with AI Agents_ Achieving Sub-700ms Latency.docx
Automating Call Centers with AI Agents_ Achieving Sub-700ms Latency.docx
Ihor Hamal
 
The fundamental misunderstanding in Team Topologies
The fundamental misunderstanding in Team TopologiesThe fundamental misunderstanding in Team Topologies
The fundamental misunderstanding in Team Topologies
Patricia Aas
 
Is Your QA Team Still Working in Silos? Here's What to Do.
Is Your QA Team Still Working in Silos? Here's What to Do.Is Your QA Team Still Working in Silos? Here's What to Do.
Is Your QA Team Still Working in Silos? Here's What to Do.
marketing943205
 
Outcome Over Output: How UXers Can Leverage an Outcome-Based Mindset by Malin...
Outcome Over Output: How UXers Can Leverage an Outcome-Based Mindset by Malin...Outcome Over Output: How UXers Can Leverage an Outcome-Based Mindset by Malin...
Outcome Over Output: How UXers Can Leverage an Outcome-Based Mindset by Malin...
UXPA Boston
 
Storage Setup for LINSTOR/DRBD/CloudStack
Storage Setup for LINSTOR/DRBD/CloudStackStorage Setup for LINSTOR/DRBD/CloudStack
Storage Setup for LINSTOR/DRBD/CloudStack
ShapeBlue
 
Reducing Bugs With Static Code Analysis php tek 2025
Reducing Bugs With Static Code Analysis php tek 2025Reducing Bugs With Static Code Analysis php tek 2025
Reducing Bugs With Static Code Analysis php tek 2025
Scott Keck-Warren
 
AI needs Hybrid Cloud - TEC conference 2025.pptx
AI needs Hybrid Cloud - TEC conference 2025.pptxAI needs Hybrid Cloud - TEC conference 2025.pptx
AI needs Hybrid Cloud - TEC conference 2025.pptx
Shikha Srivastava
 
UX for Data Engineers and Analysts-Designing User-Friendly Dashboards for Non...
UX for Data Engineers and Analysts-Designing User-Friendly Dashboards for Non...UX for Data Engineers and Analysts-Designing User-Friendly Dashboards for Non...
UX for Data Engineers and Analysts-Designing User-Friendly Dashboards for Non...
UXPA Boston
 
Stretching CloudStack over multiple datacenters
Stretching CloudStack over multiple datacentersStretching CloudStack over multiple datacenters
Stretching CloudStack over multiple datacenters
ShapeBlue
 
Breaking it Down: Microservices Architecture for PHP Developers
Breaking it Down: Microservices Architecture for PHP DevelopersBreaking it Down: Microservices Architecture for PHP Developers
Breaking it Down: Microservices Architecture for PHP Developers
pmeth1
 
How to Integrate FME with Databricks (and Why You’ll Want To)
How to Integrate FME with Databricks (and Why You’ll Want To)How to Integrate FME with Databricks (and Why You’ll Want To)
How to Integrate FME with Databricks (and Why You’ll Want To)
Safe Software
 
Apache CloudStack 101 - Introduction, What’s New and What’s Coming
Apache CloudStack 101 - Introduction, What’s New and What’s ComingApache CloudStack 101 - Introduction, What’s New and What’s Coming
Apache CloudStack 101 - Introduction, What’s New and What’s Coming
ShapeBlue
 
Building the plane as it flies through a black hole: revising five UX researc...
Building the plane as it flies through a black hole: revising five UX researc...Building the plane as it flies through a black hole: revising five UX researc...
Building the plane as it flies through a black hole: revising five UX researc...
UXPA Boston
 
GraphSummit Singapore Master Deck - May 20, 2025
GraphSummit Singapore Master Deck - May 20, 2025GraphSummit Singapore Master Deck - May 20, 2025
GraphSummit Singapore Master Deck - May 20, 2025
Neo4j
 
Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)
Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)
Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)
HusseinMalikMammadli
 
Managing Geospatial Open Data Serverlessly [AWS Community Day CH 2025]
Managing Geospatial Open Data Serverlessly [AWS Community Day CH 2025]Managing Geospatial Open Data Serverlessly [AWS Community Day CH 2025]
Managing Geospatial Open Data Serverlessly [AWS Community Day CH 2025]
Chris Bingham
 
Planetek Italia Corporate Profile Brochure
Planetek Italia Corporate Profile BrochurePlanetek Italia Corporate Profile Brochure
Planetek Italia Corporate Profile Brochure
Planetek Italia Srl
 
AI-Powered Prototyping: Building an Onboarding Flow with Cursor by Ivana Milicic
AI-Powered Prototyping: Building an Onboarding Flow with Cursor by Ivana MilicicAI-Powered Prototyping: Building an Onboarding Flow with Cursor by Ivana Milicic
AI-Powered Prototyping: Building an Onboarding Flow with Cursor by Ivana Milicic
UXPA Boston
 
Building Connected Agents: An Overview of Google's ADK and A2A Protocol
Building Connected Agents:  An Overview of Google's ADK and A2A ProtocolBuilding Connected Agents:  An Overview of Google's ADK and A2A Protocol
Building Connected Agents: An Overview of Google's ADK and A2A Protocol
Suresh Peiris
 
UX Change Fatigue: Building Resilient Teams in Times of Transformation by Mal...
UX Change Fatigue: Building Resilient Teams in Times of Transformation by Mal...UX Change Fatigue: Building Resilient Teams in Times of Transformation by Mal...
UX Change Fatigue: Building Resilient Teams in Times of Transformation by Mal...
UXPA Boston
 
Automating Call Centers with AI Agents_ Achieving Sub-700ms Latency.docx
Automating Call Centers with AI Agents_ Achieving Sub-700ms Latency.docxAutomating Call Centers with AI Agents_ Achieving Sub-700ms Latency.docx
Automating Call Centers with AI Agents_ Achieving Sub-700ms Latency.docx
Ihor Hamal
 
Ad

My design patterns

  • 2. Agenda Structural Design Patterns: Adapter Decorator Bridge Facade
  • 3. Structural Patterns What? Defines composition between entities to build larger systems. Why? Helps in understanding the relationship between classes and objects. How? By using following Patterns: Adapter, Facade, Bridge, Decorator, etc.
  • 4. Adapter Pattern What? Translate one interface of a class into a compatible interface. Why? And old legacy class needs to be reused, but its interface is different than application expects .
  • 6. Decorator Pattern What? Defines attaching new responsibility to the object dynamically. Why? Helps in wrapping an existing object with another object with out breaking the interface or other objects.
  • 8. Bridge Pattern What? Separates objects interface and its implementation. Why? Both abstraction and implementation can vary independently. Avoiding hard binding between abstraction and implementation. Reduce number of sub classes and this reduction in code size.
  • 9. Example: House electrical equipment and switch Text file storage and representation across operating systems.
  • 10. Facade Pattern What? An Higher level interface to a complex sub-system to simplify communication. Why? Re-structuring a complex system into less complex sub-systems Reduce dependencies between sub-systems .
  • 11. Example: Client Object 1 Client Object 2 Client objects Sub-systems objects Ordering System Billing System Query System Client Object 3
  • 12. With Facade Pattern: Example: Customer Service Support system Library Management system Client objects Sub-system objects Facade Client Object 2 Client Object 1 Client Object 3 Billing System Ordering System
  • 13. When to choose what: Adapter: You want to use an existing class, and its interface does not match the one you need. Decorator: When you want to enhance the responsibilities of an object. When extension for an object via sub-classing is complex/tedious. Bridge: Only applied before the classes are designed. When both side of the interfaces can vary independently.
  • 14. Facade: When you want to define new interface for a group of objects with out adding new functionality. When you want to represent 1 object for a group of objects to simplify communication.
  翻译: