SlideShare a Scribd company logo
2
Most read
5
Most read
16
Most read
Adapter Pattern

Shahriar Iqbal Chowdhury & Monjurul Habib
            Code Name: Remington

    http://www.facebook.com/groups/netter/
What is Adapter
• A device for connecting pieces of equipment that
  cannot be connected directly




• An adapter allows classes to work together that
  normally could not because of incompatible
  interfaces
Missing something??
How does it work?
When we need?
• Convert the interface of a class into another
  interface that client expects.
• Allow classes to work together that couldn’t
  because of incompatible interfaces.
• Future clients can be satisfied through the creation
  of additional concrete Adapter.
• Adapter is meant to change the interface of an
  existing object.
• A way to achieve OCP(Open/Closed Principle)
Client   Component
Client
    Adapter




Component/
  Adaptee
Adapters in the real world
UML Structure
Way to use (ref. DoFactory)
Client
Adapter
Adaptee
Another shocking example
Adapter @.NET Framework
• From .NET-based code you can easily call legacy COM
  objects and vice versa.
• Behind the scenes, Visual Studio® .NET create a Runtime
  Callable Wrapper (RCW) class. Inside the RCW, .NET specific
  format is converted into a format that the COM component
  expects and vise versa.
• Data Adapters adapts data from different source (SQL
  Server, Oracle, ODBC, OLE DB) to dataset.
• Different Data Adapter classes are used
SqlDataAdapter
OdbcDataAdapter
OleDbDataAdapter
Real World Scenario’s
• Most of the applications using third party libraries
  use adapters as a middle layer between the
  application and the 3rd party library.
• Memory card reader software

More Related Content

PPTX
Adapter Design Pattern
PPT
Prototype pattern
PPT
Facade pattern
PPT
Adapter pattern
PPT
Software Design Patterns
PPT
Flyweight pattern
PPTX
Design Patterns - Abstract Factory Pattern
PPT
Adapter Design Pattern
Adapter Design Pattern
Prototype pattern
Facade pattern
Adapter pattern
Software Design Patterns
Flyweight pattern
Design Patterns - Abstract Factory Pattern
Adapter Design Pattern

What's hot (20)

ZIP
Adapter Design Pattern
PPTX
Facade Design Pattern
PPTX
Prototype design patterns
PPTX
Factory Method Pattern
PPT
Prototype Design Pattern
PDF
Java Course 11: Design Patterns
PPT
Composite pattern
PDF
PPT
Builder pattern
PDF
Collaboration diagram- UML diagram
PPTX
Creational pattern
PPTX
Visitor Pattern
PPT
Composite Design Pattern
PPT
Bridge Design Pattern
PDF
Design patterns
PPTX
Uml Presentation
PPTX
Adapter Pattern
PPT
Abstract Factory Pattern
PPT
Design Patterns
PDF
Java Design Patterns Tutorial | Edureka
Adapter Design Pattern
Facade Design Pattern
Prototype design patterns
Factory Method Pattern
Prototype Design Pattern
Java Course 11: Design Patterns
Composite pattern
Builder pattern
Collaboration diagram- UML diagram
Creational pattern
Visitor Pattern
Composite Design Pattern
Bridge Design Pattern
Design patterns
Uml Presentation
Adapter Pattern
Abstract Factory Pattern
Design Patterns
Java Design Patterns Tutorial | Edureka
Ad

Viewers also liked (20)

PDF
Adapter Pattern Abhijit Hiremagalur 200603
PPT
Design patterns - Adapter Pattern
PPTX
Structural Design pattern - Adapter
PPTX
Presentation on Template Method Design Pattern
PPTX
Apply Template Method Pattern in Report Implementation
PPT
The benefits of erp products
PPT
Template Method Pattern
PPTX
Strategy Pattern
PDF
Strategy Design Pattern
PPTX
Decorator Pattern
PPT
Template Method Design Pattern
PPTX
Design Patterns - Part 1 of 2
PPT
Template method pattern example
PPT
Cost of quality
PDF
Design pattern tutorial
PDF
Cost of Quality
PPTX
Cost of Quality
PPTX
Gof design patterns
PPT
Cost Of Quality
Adapter Pattern Abhijit Hiremagalur 200603
Design patterns - Adapter Pattern
Structural Design pattern - Adapter
Presentation on Template Method Design Pattern
Apply Template Method Pattern in Report Implementation
The benefits of erp products
Template Method Pattern
Strategy Pattern
Strategy Design Pattern
Decorator Pattern
Template Method Design Pattern
Design Patterns - Part 1 of 2
Template method pattern example
Cost of quality
Design pattern tutorial
Cost of Quality
Cost of Quality
Gof design patterns
Cost Of Quality
Ad

Similar to Adapter Design Pattern (20)

PPTX
Adapter design pattern
PPTX
Presentation on adapter pattern
PDF
Software and architecture design pattern
PPTX
Adapter Design Pattern
PPTX
Design Patern::Adaptor pattern
PPT
CASE Tools lab.ppt
PPTX
Adapter design-pattern2015
PPT
Adapter pattern
PPT
Chap14 ado.net
PPTX
PPTX
GoF Design patterns I: Introduction + Structural Patterns
PPTX
PPTX
Design Pattern lecture 3
PPT
ASP.NET System design 2
PPTX
Some Cool Design Patterns, Practices, and Principles
DOCX
Patterns (contd)Software Development ProcessDesign patte.docx
PDF
software Structural design pattern Adapter
PPS
Design Patterns For 70% Of Programmers In The World
PPTX
Segue to design patterns
Adapter design pattern
Presentation on adapter pattern
Software and architecture design pattern
Adapter Design Pattern
Design Patern::Adaptor pattern
CASE Tools lab.ppt
Adapter design-pattern2015
Adapter pattern
Chap14 ado.net
GoF Design patterns I: Introduction + Structural Patterns
Design Pattern lecture 3
ASP.NET System design 2
Some Cool Design Patterns, Practices, and Principles
Patterns (contd)Software Development ProcessDesign patte.docx
software Structural design pattern Adapter
Design Patterns For 70% Of Programmers In The World
Segue to design patterns

More from Shahriar Iqbal Chowdhury (14)

PPTX
Cloud friendly Enterprise Architecture
PPTX
Interactive SDLC
PPTX
Enterprise business Inteligence
PPTX
Cloud Computing
PPTX
Version control
PPTX
Application development gadget & gears
PPTX
Design Pattern that every cloud developer must know
PPTX
Strategy Pattern
PPTX
Observer pattern
PPTX
Factory method pattern
Cloud friendly Enterprise Architecture
Interactive SDLC
Enterprise business Inteligence
Cloud Computing
Version control
Application development gadget & gears
Design Pattern that every cloud developer must know
Strategy Pattern
Observer pattern
Factory method pattern

Recently uploaded (20)

PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Modernizing your data center with Dell and AMD
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Encapsulation theory and applications.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPT
Teaching material agriculture food technology
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Electronic commerce courselecture one. Pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
Chapter 3 Spatial Domain Image Processing.pdf
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Digital-Transformation-Roadmap-for-Companies.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
Review of recent advances in non-invasive hemoglobin estimation
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Modernizing your data center with Dell and AMD
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Approach and Philosophy of On baking technology
Encapsulation theory and applications.pdf
MYSQL Presentation for SQL database connectivity
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Teaching material agriculture food technology
The AUB Centre for AI in Media Proposal.docx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Electronic commerce courselecture one. Pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Reach Out and Touch Someone: Haptics and Empathic Computing

Adapter Design Pattern

  • 1. Adapter Pattern Shahriar Iqbal Chowdhury & Monjurul Habib Code Name: Remington http://www.facebook.com/groups/netter/
  • 2. What is Adapter • A device for connecting pieces of equipment that cannot be connected directly • An adapter allows classes to work together that normally could not because of incompatible interfaces
  • 4. How does it work?
  • 5. When we need? • Convert the interface of a class into another interface that client expects. • Allow classes to work together that couldn’t because of incompatible interfaces. • Future clients can be satisfied through the creation of additional concrete Adapter. • Adapter is meant to change the interface of an existing object. • A way to achieve OCP(Open/Closed Principle)
  • 6. Client Component
  • 7. Client Adapter Component/ Adaptee
  • 8. Adapters in the real world
  • 10. Way to use (ref. DoFactory)
  • 15. Adapter @.NET Framework • From .NET-based code you can easily call legacy COM objects and vice versa. • Behind the scenes, Visual Studio® .NET create a Runtime Callable Wrapper (RCW) class. Inside the RCW, .NET specific format is converted into a format that the COM component expects and vise versa. • Data Adapters adapts data from different source (SQL Server, Oracle, ODBC, OLE DB) to dataset. • Different Data Adapter classes are used SqlDataAdapter OdbcDataAdapter OleDbDataAdapter
  • 16. Real World Scenario’s • Most of the applications using third party libraries use adapters as a middle layer between the application and the 3rd party library. • Memory card reader software