- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Adapter Pattern in C++?
An adapter pattern is used to convert the interface of a class into an interface that is expected by the client. An adapter helps the programmer to make its classes work together and make sure the user requirement is fulfilled by making incompatible interfaces completable.
let's understand a bit more about the adapter pattern. The concept of adapter is taken from the real world. as in the real world We use adapters to connect things that are incompatible with each other. let's take an example, in modern day smartphones the 3.5 mm jack for earphones is missing, so the brands have come up with an adapter that connects the regular charging port of the smartphones to 3.5 mm jack. The same work is done by an adapter and programming too, i.e. connecting two dissimilar interfaces.
let's take a scenario where the adapter can be used and the program,
Suppose we have created a program that does some function, but declined expect some other type of object. so in this case, the programmer will use an adapter that will convert the original interface into the one requested by client.
- Related Articles
- Adapter properties dropdown not updated with list even after installation (SAP 7.2 adapter)
- 132 Pattern in C++
- Word Pattern in C++
- How to update RecyclerView Adapter Data in Android?
- Base Expandable List Adapter in Android with Example
- Printing Heart Pattern in C
- Composite Design Pattern in C++
- Repeated Substring Pattern in C++
- Printing Interesting pattern in C++
- Word Pattern II in C++
- How to update RecyclerView Adapter Data?
- Difference between FragmentPagerAdapter and FragmentStatePager Adapter
- What are the Adapter and Memento Patterns in Swift?
- Different Star Pattern Programs in C#
- Pattern matching in C# with Regex
