SlideShare a Scribd company logo
Presentation on
Adapter Design Pattern
Presented by
Tanim Ahmed (1507113)
Md. Zabirul Islam (1507110)
Md. Motaleb Hossen Manik (1507114)
1
Do you know what is adapter pattern?
▪ The adapter pattern convert the interface of a class into another interface that
clients expect. Adapter lets classes work together that couldn’t otherwise because
of incompatible interfaces.
▪ Wikipedia says…
▪ In software engineering, the adapter pattern is a software design pattern that
allows the interface of an existing class to be used as another interface. It is often
used to make existing classes work with others without modifying their source
code.
2
In real life example
Consider that you have some pictures in your memory card and you need to transfer them to your
computer.
In order to transfer them you need some kind of adapter that is compatible with your computer ports
so that you can attach memory card to your computer.
In this case card reader is an adapter. Another example would be the famous power adapter;
a three legged plug can't be connected to a two pronged outlet,
it needs to use a power adapter that makes it compatible with the two pronged outlet.
Yet another example would be a translator translating words spoken by one person to another
3
Adapter…
4
ANOTHER EXAMPLE
▪ Real Life Example of Adapter Pattern:
suppose I am a ProgrammingTeacher, and I have two types of
students in my class, the American students and the Bangladeshi
students, since my American students don’t understand Bangla, i
have to have a translator that will translate my lectures to my
American students.
▪ In this example, a Student class will be theTarget, the translator will
be the Adapter, and the American students will be the Adaptee, like
the class diagram below:
5
Class Diagram Of Adapter Pattern
6
student
translator American student
Context
▪ Context:
▪ You are building an inheritance hierarchy and want to
incorporate into it an existing class.
▪ The reused class is also often already part of its own
inheritance hierarchy.
7
Adapter Pattern
Problem Continued…
▪ Some problems are faced during designing any system using Adapter
design pattern
▪ When there is polymorphism
▪ There may have function with same name but with different
signature
▪ User may have written a separate class for a specific task. But as the
user should go through Polymorphism, this separate class is unused.
8
Adapter Pattern
Problem Continued…
9
Here is already written class called xyzcircle that deals with
circles already. But we can’t use directly because we want to
preserve polymorphic behavior with Shape
Adapter Pattern
Forces
▪ Some languages may not support multiple inheritances (e.g. Java)
▪ More forwarding requests
▪ Increase in the overhead
▪ Adapter chaining in created to reach to specific type
▪ Complex adaptation
10
11
Adapter Pattern Design example
12
Summary
▪ The Adapter Pattern is extremely useful when combined with
SOLID design principles and it helps developers to write a cleaner
and more maintainable code.
References
▪ 1. https://www.slideshare.net/adeelr456/adapter-design-pattern-
45257387
▪ 2.https://www.slideshare.net/adeelr/qid=4ce8b50c-e14a-4cbb-8b62-
82ba26259f22&v=&b=&from_search=2
13
ThankYou
14

More Related Content

PPT
Introduction to .NET Framework
PPTX
Static dynamic and active web pages
PPT
Adapter pattern
PDF
Virtualization Approach: Theory and Application
ODP
Evolutionary process models se.ppt
PPTX
PPTX
Chapter five HCI
PPTX
Software Engineering
Introduction to .NET Framework
Static dynamic and active web pages
Adapter pattern
Virtualization Approach: Theory and Application
Evolutionary process models se.ppt
Chapter five HCI
Software Engineering

What's hot (20)

PPTX
Android share preferences
PPS
Virus & Computer security threats
PPT
Software Testing Strategies
PPT
GUI Programming In Java
PPT
Web Engineering
PDF
Introduction to fragments in android
PPTX
Web technologies: HTTP
PPT
Web engineering
PPT
Unit 1( modelling concepts & class modeling)
PPTX
Web Engineering - Web Application Testing
PPTX
Updating Operating Systems and Applications
PPTX
Unix Operating System
PPT
Adapter Design Pattern
PDF
Sequence diagrams
PDF
Android intents
PDF
UML Diagrams- Unified Modeling Language Introduction
PPTX
The Singleton Pattern Presentation
PPTX
Factory Method Pattern
PPTX
Protection and security of operating system
PPT
12 multi-threading
 
Android share preferences
Virus & Computer security threats
Software Testing Strategies
GUI Programming In Java
Web Engineering
Introduction to fragments in android
Web technologies: HTTP
Web engineering
Unit 1( modelling concepts & class modeling)
Web Engineering - Web Application Testing
Updating Operating Systems and Applications
Unix Operating System
Adapter Design Pattern
Sequence diagrams
Android intents
UML Diagrams- Unified Modeling Language Introduction
The Singleton Pattern Presentation
Factory Method Pattern
Protection and security of operating system
12 multi-threading
 
Ad

Similar to Presentation on adapter pattern (20)

PPTX
Adapter design pattern
PDF
Advanced Programming _Abstract Classes vs Interfaces (Java)
PDF
Top interview questions in c
DOCX
Mca 4030 programming in java
DOCX
Mit103 object oriented programming
PPTX
GoF Design patterns I: Introduction + Structural Patterns
DOCX
Mca 4030 programming in java
DOCX
Mca 4030 programming in java
PPTX
Data Types and Physical Data Models MS Access
PPTX
Data Types and Physical Data Models v 123
PDF
Metamorphic Domain-Specific Languages
PPTX
From Good to SOLID: How to become a better PHP developer
DOCX
Object relationship mapping and hibernate
PDF
Single Responsibility Principle
PDF
Frequently asked tcs technical interview questions and answers
PPTX
Cs 1023 lec 8 design pattern (week 2)
PPTX
Lecture 18
PPTX
java training in chennai
Adapter design pattern
Advanced Programming _Abstract Classes vs Interfaces (Java)
Top interview questions in c
Mca 4030 programming in java
Mit103 object oriented programming
GoF Design patterns I: Introduction + Structural Patterns
Mca 4030 programming in java
Mca 4030 programming in java
Data Types and Physical Data Models MS Access
Data Types and Physical Data Models v 123
Metamorphic Domain-Specific Languages
From Good to SOLID: How to become a better PHP developer
Object relationship mapping and hibernate
Single Responsibility Principle
Frequently asked tcs technical interview questions and answers
Cs 1023 lec 8 design pattern (week 2)
Lecture 18
java training in chennai
Ad

Recently uploaded (20)

PPTX
BSCS lesson 3.pptxnbbjbb mnbkjbkbbkbbkjb
PPT
pump pump is a mechanism that is used to transfer a liquid from one place to ...
PPTX
AD Bungalow Case studies Sem 2.pptxvwewev
PDF
Skskkxiixijsjsnwkwkaksixindndndjdjdjsjjssk
PDF
The Advantages of Working With a Design-Build Studio
PPTX
Fundamental Principles of Visual Graphic Design.pptx
PPTX
DOC-20250430-WA0014._20250714_235747_0000.pptx
PDF
Key Trends in Website Development 2025 | B3AITS - Bow & 3 Arrows IT Solutions
PPTX
mahatma gandhi bus terminal in india Case Study.pptx
PDF
Trusted Executive Protection Services in Ontario — Discreet & Professional.pdf
PPTX
YV PROFILE PROJECTS PROFILE PRES. DESIGN
PPTX
Complete Guide to Microsoft PowerPoint 2019 – Features, Tools, and Tips"
PDF
Urban Design Final Project-Site Analysis
PDF
SEVA- Fashion designing-Presentation.pdf
PDF
Interior Structure and Construction A1 NGYANQI
PPTX
Tenders & Contracts Works _ Services Afzal.pptx
PPTX
AC-Unit1.pptx CRYPTOGRAPHIC NNNNFOR ALL
PPTX
rapid fire quiz in your house is your india.pptx
PDF
Urban Design Final Project-Context
PDF
Phone away, tabs closed: No multitasking
BSCS lesson 3.pptxnbbjbb mnbkjbkbbkbbkjb
pump pump is a mechanism that is used to transfer a liquid from one place to ...
AD Bungalow Case studies Sem 2.pptxvwewev
Skskkxiixijsjsnwkwkaksixindndndjdjdjsjjssk
The Advantages of Working With a Design-Build Studio
Fundamental Principles of Visual Graphic Design.pptx
DOC-20250430-WA0014._20250714_235747_0000.pptx
Key Trends in Website Development 2025 | B3AITS - Bow & 3 Arrows IT Solutions
mahatma gandhi bus terminal in india Case Study.pptx
Trusted Executive Protection Services in Ontario — Discreet & Professional.pdf
YV PROFILE PROJECTS PROFILE PRES. DESIGN
Complete Guide to Microsoft PowerPoint 2019 – Features, Tools, and Tips"
Urban Design Final Project-Site Analysis
SEVA- Fashion designing-Presentation.pdf
Interior Structure and Construction A1 NGYANQI
Tenders & Contracts Works _ Services Afzal.pptx
AC-Unit1.pptx CRYPTOGRAPHIC NNNNFOR ALL
rapid fire quiz in your house is your india.pptx
Urban Design Final Project-Context
Phone away, tabs closed: No multitasking

Presentation on adapter pattern

  • 1. Presentation on Adapter Design Pattern Presented by Tanim Ahmed (1507113) Md. Zabirul Islam (1507110) Md. Motaleb Hossen Manik (1507114) 1
  • 2. Do you know what is adapter pattern? ▪ The adapter pattern convert the interface of a class into another interface that clients expect. Adapter lets classes work together that couldn’t otherwise because of incompatible interfaces. ▪ Wikipedia says… ▪ In software engineering, the adapter pattern is a software design pattern that allows the interface of an existing class to be used as another interface. It is often used to make existing classes work with others without modifying their source code. 2
  • 3. In real life example Consider that you have some pictures in your memory card and you need to transfer them to your computer. In order to transfer them you need some kind of adapter that is compatible with your computer ports so that you can attach memory card to your computer. In this case card reader is an adapter. Another example would be the famous power adapter; a three legged plug can't be connected to a two pronged outlet, it needs to use a power adapter that makes it compatible with the two pronged outlet. Yet another example would be a translator translating words spoken by one person to another 3
  • 5. ANOTHER EXAMPLE ▪ Real Life Example of Adapter Pattern: suppose I am a ProgrammingTeacher, and I have two types of students in my class, the American students and the Bangladeshi students, since my American students don’t understand Bangla, i have to have a translator that will translate my lectures to my American students. ▪ In this example, a Student class will be theTarget, the translator will be the Adapter, and the American students will be the Adaptee, like the class diagram below: 5
  • 6. Class Diagram Of Adapter Pattern 6 student translator American student
  • 7. Context ▪ Context: ▪ You are building an inheritance hierarchy and want to incorporate into it an existing class. ▪ The reused class is also often already part of its own inheritance hierarchy. 7
  • 8. Adapter Pattern Problem Continued… ▪ Some problems are faced during designing any system using Adapter design pattern ▪ When there is polymorphism ▪ There may have function with same name but with different signature ▪ User may have written a separate class for a specific task. But as the user should go through Polymorphism, this separate class is unused. 8
  • 9. Adapter Pattern Problem Continued… 9 Here is already written class called xyzcircle that deals with circles already. But we can’t use directly because we want to preserve polymorphic behavior with Shape
  • 10. Adapter Pattern Forces ▪ Some languages may not support multiple inheritances (e.g. Java) ▪ More forwarding requests ▪ Increase in the overhead ▪ Adapter chaining in created to reach to specific type ▪ Complex adaptation 10
  • 12. 12 Summary ▪ The Adapter Pattern is extremely useful when combined with SOLID design principles and it helps developers to write a cleaner and more maintainable code.
  • 13. References ▪ 1. https://www.slideshare.net/adeelr456/adapter-design-pattern- 45257387 ▪ 2.https://www.slideshare.net/adeelr/qid=4ce8b50c-e14a-4cbb-8b62- 82ba26259f22&v=&b=&from_search=2 13