SlideShare a Scribd company logo
04 Adapter and Façade PatternDesign Patterns© Prafulla Paraskar 2010
AdapterStructural Design Pattern© Prafulla Paraskar 2010
DefinitionThe adapter pattern (often referred to as the wrapper pattern or simply a wrapper) is a design pattern that translates one interface for a class into a compatible interface. (wikipedia)© Prafulla Paraskar 2010
Adapter Pattern – Explained (1/2)© Prafulla Paraskar 2010
Adapter Pattern – Explained (2/2) An adapter allows classes to work together that normally could not because of incompatible interfaces, by providing its interface to clients while using the original interface.The adapter translates calls to its interface into calls to the original interface, and the amount of code necessary to do this is typically small.The adapter is also responsible for transforming data into appropriate forms.© Prafulla Paraskar 2010
Adapter Pattern – Types of AdaptersClass adapterSimple and versatile, invisible to the client.Object adapterExtensible to subclasses of the adapter.Two-way adapterEnables different clients to view an object differently.Pluggable adapterPresence of adapter is transparent; it can be put in and taken out. Several adapter can be active.© Prafulla Paraskar 2010
Adapter Pattern – UML Diagram© Prafulla Paraskar 2010
Adapter Pattern – Real World SamplesAC adaptorsCar charger for mobile phonesCOM InterOp in .NETSQLAdapter in .NET© Prafulla Paraskar 2010
Adapter Pattern – GuidelinesYou have :A domain specific interface.A Class to connect to with a mismatching interface.You Want :Create a reusable class to cooperate with yet-to-be-built classes.Change the names of methods as called and as implemented.Support different sets of methods for different purposes.© Prafulla Paraskar 2010
FacadeStructural Design Pattern© Prafulla Paraskar 2010
DefinitionA facade is an object that provides a simplified interface to a larger body of code, such as a class library (wikipedia).© Prafulla Paraskar 2010
Façade Pattern – Explained (1/2)© Prafulla Paraskar 2010
Façade Pattern – Explained (2/2)The name is by analogy to an architectural facade.A facade can:make a software library easier to use and understand and test, since the facade has convenient methods for common tasks.make code that uses the library more readable, for the same reason.reduce dependencies of outside code on the inner workings of a library, since most code uses the facade, thus allowing more flexibility in developing the system.wrap a poorly-designed collection of APIs with a single well-designed API (as per task needs).© Prafulla Paraskar 2010
Façade Pattern – Types of AdaptersOpaqueSubsystem operations can only be called through the Façade.TransparentSubsystem operations can be called directly as well as through the Façade.SingletonOnly one instance of the Façade is meaningful.© Prafulla Paraskar 2010
Façade Pattern – UML Diagram© Prafulla Paraskar 2010
Façade Pattern – Real World SamplesWedding planners / Event management.DirectX / OpenGLOnline bill paymentMacros in MS Office© Prafulla Paraskar 2010
Façade Pattern – GuidelinesWhen:A system has several identifiable subsystems and:The abstractions and implementations of a subsystem are tightly coupled.The system evolves and gets more complex, but early adapters might want to retain their simple views.You want to provide alternative novice, intermediate and power user interfaces.There is a need for an entry point to each level of layered software. © Prafulla Paraskar 2010
Thank you!http://geekswithblogs.net/technomadPresentation by Prafulla Paraskar  prafulla.paraskar@s1.com© 2010 S1 India Pvt. Ltd.Presentation by Prafulla Paraskar  eprafulla@gmail.com© 2010  Prafulla Paraskar

More Related Content

PPT
Facade pattern
PDF
Presentation facade design pattern
PPTX
Facade Pattern
PPT
Adapter pattern
PPTX
Adapter Design Pattern
PPTX
Facade pattern presentation(.pptx)
PPTX
Adapter Design Pattern
PPT
Facade pattern
Facade pattern
Presentation facade design pattern
Facade Pattern
Adapter pattern
Adapter Design Pattern
Facade pattern presentation(.pptx)
Adapter Design Pattern
Facade pattern

What's hot (20)

PPT
Adapter Design Pattern
PPTX
Implementing the Adapter Design Pattern
PPT
Bridge Design Pattern
PPTX
Structural Design pattern - Adapter
PPTX
Facade Design Pattern
PDF
Adapter Pattern Abhijit Hiremagalur 200603
PPTX
Adapter design-pattern2015
ODP
Bridge
PPT
Builder pattern
PPTX
Design pattern - Facade Pattern
PDF
Solid principles, Design Patterns, and Domain Driven Design
PPTX
Facade design pattern
PPTX
Creational pattern
PPTX
Architectural Design Pattern: Android
PPTX
Design patterns
PDF
Knockout.js components&routing
PPTX
Composite design pattern
PPTX
Design Pattern - Introduction
PPTX
Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile
PPTX
Mule edifact module
Adapter Design Pattern
Implementing the Adapter Design Pattern
Bridge Design Pattern
Structural Design pattern - Adapter
Facade Design Pattern
Adapter Pattern Abhijit Hiremagalur 200603
Adapter design-pattern2015
Bridge
Builder pattern
Design pattern - Facade Pattern
Solid principles, Design Patterns, and Domain Driven Design
Facade design pattern
Creational pattern
Architectural Design Pattern: Android
Design patterns
Knockout.js components&routing
Composite design pattern
Design Pattern - Introduction
Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile
Mule edifact module
Ad

Viewers also liked (20)

ZIP
Adapter Design Pattern
PPTX
Design pattern
PPT
Design Patterns
PPTX
Code Like a Ninja Session 8 - Structural Design Patterns
PDF
Android ui adapter
PDF
Android sync adapter
PPTX
Design Patterns - 03 Composite and Flyweight Pattern
PPTX
Presentation on townplanning of irfhaa fathe (1)
PDF
Leads facade- Design Develope Deliver
PPTX
Design pattern part 1
PPTX
Design Patterns - 01 Introduction and Decorator Pattern
PPTX
Proxy & adapter pattern
ODP
Design Patterns Part1
PPT
Design patterns structuralpatterns(theadapterpattern)
 
PPT
Command and Adapter Pattern
PDF
Adapter & ListView & ExpandalbeListView
PPTX
Chandigarh town planning final 24.12.16
PDF
The 23 gof design patterns in java ,the summary
PPTX
Decorator Pattern
Adapter Design Pattern
Design pattern
Design Patterns
Code Like a Ninja Session 8 - Structural Design Patterns
Android ui adapter
Android sync adapter
Design Patterns - 03 Composite and Flyweight Pattern
Presentation on townplanning of irfhaa fathe (1)
Leads facade- Design Develope Deliver
Design pattern part 1
Design Patterns - 01 Introduction and Decorator Pattern
Proxy & adapter pattern
Design Patterns Part1
Design patterns structuralpatterns(theadapterpattern)
 
Command and Adapter Pattern
Adapter & ListView & ExpandalbeListView
Chandigarh town planning final 24.12.16
The 23 gof design patterns in java ,the summary
Decorator Pattern
Ad

Similar to Design Patterns - 04 Adapter and Facade Pattern (20)

PPTX
PPT
My design patterns
PPTX
PATTERNS04 - Structural Design Patterns
PPT
Software Design Patterns
PPTX
Patterns
PPT
Introduction to design_patterns
PPTX
Design patterns
PPTX
Gof design patterns
PPTX
Design patterns
PPTX
Design pattern and their application
PDF
Software and architecture design pattern
PPTX
Facadepattern
PDF
software engineering Design Patterns.pdf
PPTX
Let us understand design pattern
PDF
轉接器模式與表象模式
PPT
Software Design Patterns
PPT
Software Design Patterns
PPT
Design Patterns
PPT
Introduction To Design Patterns
PPT
Bartlesville Dot Net User Group Design Patterns
My design patterns
PATTERNS04 - Structural Design Patterns
Software Design Patterns
Patterns
Introduction to design_patterns
Design patterns
Gof design patterns
Design patterns
Design pattern and their application
Software and architecture design pattern
Facadepattern
software engineering Design Patterns.pdf
Let us understand design pattern
轉接器模式與表象模式
Software Design Patterns
Software Design Patterns
Design Patterns
Introduction To Design Patterns
Bartlesville Dot Net User Group Design Patterns

Recently uploaded (20)

PPTX
AC-Unit1.pptx CRYPTOGRAPHIC NNNNFOR ALL
PDF
Phone away, tabs closed: No multitasking
PDF
Skskkxiixijsjsnwkwkaksixindndndjdjdjsjjssk
PPTX
DOC-20250430-WA0014._20250714_235747_0000.pptx
DOCX
actividad 20% informatica microsoft project
PPTX
An introduction to AI in research and reference management
PDF
Integrated-2D-and-3D-Animation-Bridging-Dimensions-for-Impactful-Storytelling...
PPT
WHY_R12 Uaafafafpgradeaffafafafaffff.ppt
PPTX
BSCS lesson 3.pptxnbbjbb mnbkjbkbbkbbkjb
PPTX
HPE Aruba-master-icon-library_052722.pptx
PPTX
joggers park landscape assignment bandra
DOCX
The story of the first moon landing.docx
PPTX
rapid fire quiz in your house is your india.pptx
PDF
BRANDBOOK-Presidential Award Scheme-Kenya-2023
PPT
pump pump is a mechanism that is used to transfer a liquid from one place to ...
PDF
Interior Structure and Construction A1 NGYANQI
PPTX
Wisp Textiles: Where Comfort Meets Everyday Style
PDF
Quality Control Management for RMG, Level- 4, Certificate
PPTX
Entrepreneur intro, origin, process, method
PPTX
Fundamental Principles of Visual Graphic Design.pptx
AC-Unit1.pptx CRYPTOGRAPHIC NNNNFOR ALL
Phone away, tabs closed: No multitasking
Skskkxiixijsjsnwkwkaksixindndndjdjdjsjjssk
DOC-20250430-WA0014._20250714_235747_0000.pptx
actividad 20% informatica microsoft project
An introduction to AI in research and reference management
Integrated-2D-and-3D-Animation-Bridging-Dimensions-for-Impactful-Storytelling...
WHY_R12 Uaafafafpgradeaffafafafaffff.ppt
BSCS lesson 3.pptxnbbjbb mnbkjbkbbkbbkjb
HPE Aruba-master-icon-library_052722.pptx
joggers park landscape assignment bandra
The story of the first moon landing.docx
rapid fire quiz in your house is your india.pptx
BRANDBOOK-Presidential Award Scheme-Kenya-2023
pump pump is a mechanism that is used to transfer a liquid from one place to ...
Interior Structure and Construction A1 NGYANQI
Wisp Textiles: Where Comfort Meets Everyday Style
Quality Control Management for RMG, Level- 4, Certificate
Entrepreneur intro, origin, process, method
Fundamental Principles of Visual Graphic Design.pptx

Design Patterns - 04 Adapter and Facade Pattern

  • 1. 04 Adapter and Façade PatternDesign Patterns© Prafulla Paraskar 2010
  • 2. AdapterStructural Design Pattern© Prafulla Paraskar 2010
  • 3. DefinitionThe adapter pattern (often referred to as the wrapper pattern or simply a wrapper) is a design pattern that translates one interface for a class into a compatible interface. (wikipedia)© Prafulla Paraskar 2010
  • 4. Adapter Pattern – Explained (1/2)© Prafulla Paraskar 2010
  • 5. Adapter Pattern – Explained (2/2) An adapter allows classes to work together that normally could not because of incompatible interfaces, by providing its interface to clients while using the original interface.The adapter translates calls to its interface into calls to the original interface, and the amount of code necessary to do this is typically small.The adapter is also responsible for transforming data into appropriate forms.© Prafulla Paraskar 2010
  • 6. Adapter Pattern – Types of AdaptersClass adapterSimple and versatile, invisible to the client.Object adapterExtensible to subclasses of the adapter.Two-way adapterEnables different clients to view an object differently.Pluggable adapterPresence of adapter is transparent; it can be put in and taken out. Several adapter can be active.© Prafulla Paraskar 2010
  • 7. Adapter Pattern – UML Diagram© Prafulla Paraskar 2010
  • 8. Adapter Pattern – Real World SamplesAC adaptorsCar charger for mobile phonesCOM InterOp in .NETSQLAdapter in .NET© Prafulla Paraskar 2010
  • 9. Adapter Pattern – GuidelinesYou have :A domain specific interface.A Class to connect to with a mismatching interface.You Want :Create a reusable class to cooperate with yet-to-be-built classes.Change the names of methods as called and as implemented.Support different sets of methods for different purposes.© Prafulla Paraskar 2010
  • 10. FacadeStructural Design Pattern© Prafulla Paraskar 2010
  • 11. DefinitionA facade is an object that provides a simplified interface to a larger body of code, such as a class library (wikipedia).© Prafulla Paraskar 2010
  • 12. Façade Pattern – Explained (1/2)© Prafulla Paraskar 2010
  • 13. Façade Pattern – Explained (2/2)The name is by analogy to an architectural facade.A facade can:make a software library easier to use and understand and test, since the facade has convenient methods for common tasks.make code that uses the library more readable, for the same reason.reduce dependencies of outside code on the inner workings of a library, since most code uses the facade, thus allowing more flexibility in developing the system.wrap a poorly-designed collection of APIs with a single well-designed API (as per task needs).© Prafulla Paraskar 2010
  • 14. Façade Pattern – Types of AdaptersOpaqueSubsystem operations can only be called through the Façade.TransparentSubsystem operations can be called directly as well as through the Façade.SingletonOnly one instance of the Façade is meaningful.© Prafulla Paraskar 2010
  • 15. Façade Pattern – UML Diagram© Prafulla Paraskar 2010
  • 16. Façade Pattern – Real World SamplesWedding planners / Event management.DirectX / OpenGLOnline bill paymentMacros in MS Office© Prafulla Paraskar 2010
  • 17. Façade Pattern – GuidelinesWhen:A system has several identifiable subsystems and:The abstractions and implementations of a subsystem are tightly coupled.The system evolves and gets more complex, but early adapters might want to retain their simple views.You want to provide alternative novice, intermediate and power user interfaces.There is a need for an entry point to each level of layered software. © Prafulla Paraskar 2010
  • 18. Thank you!http://geekswithblogs.net/technomadPresentation by Prafulla Paraskar prafulla.paraskar@s1.com© 2010 S1 India Pvt. Ltd.Presentation by Prafulla Paraskar eprafulla@gmail.com© 2010 Prafulla Paraskar