What is Adapter Design Pattern: A brief explanation
What is Adapter Design Pattern? Adapter Design Pattern is a structural design pattern that can somewhat be compared to real-life problems we face with plugs. Before we roll out the definition, let us think of a real-life example. If you have ever travelled and stopped by a hotel you might have needed an extra adapter to plug your phone’s or laptop’s charger into the hotel’s wall outlet. This especially happens when you travel to a foreign nation. So, what are the adapters? Adapters are connectors that change the plug shape to match the electrical outlet. This is exactly what the adapter design pattern does. The adapter design pattern’s purpose is to lay down criteria that make classes work together that could not otherwise because of incompatible interfaces. The intent is to convert the interface of one class into another interface so that it becomes compatible with what the client expects. The adapter is also known as wrapper. Let us see, what is adapter design pattern?https://www.decipherzone.com/blog-detail/what-is-adapter-design-pattern
As mentioned earlier, the adapter design pattern falls in the category of structural design patterns. Structural patterns are mainly concerned with the composition of classes and objects. They follow the inheritance principle of object-oriented paradigms. The adapter design pattern makes one interface conform to another, providing a uniform abstraction of different interfaces. So, how do we define – what is adapter design pattern?
Read also: "Decorator design pattern in java with examples"
Putting everything together we have discussed so far – The adapter design pattern proposes a way to convert the interface of a class into another interface, whatever is expected by the client. Adapter Design Interface allows us to design our system in such a way that allows incompatible classes to work together. What is the motivation of object adapter design pattern? Why would we adhere to such a concept?
Articles from Mahipal NehraView blog
Developers have been using three major building blocks for the development of web apps, namely, APIs ...
Microservices architecture enables a system to be divided into multiple smaller, individual and inde ...
You may be interested in these jobs
Found in: Talent IN - 4 days ago
GOGOX New Delhi
Location : Delhi NCR/Maharashtra/Hyderabad · What You Will Deliver · Responsible for growth for the region · Work closely with sourcing team and operations team to ensure the client expectations are properly met in terms of time and quality of sourcing · Build and develop the tea ...
Found in: Talent IN - 5 days ago
Concentrix Gurugram Full time
Job Description 1. Collaborating with offshore/local management and development team to identify end-user requirements and specifications; · 2. Developing, Testing and Deploying in-house data management and data governance applications/platforms; · 3. Troubleshooting, debugging, ...
Found in: Talent IN± - 1 week ago
Job Title: · Production Engineer (H) · Grade: · Junior Engineer · Location: · Neemrana, Rajasthan · Company: · Hitachi Astemo Gurugram Powertrain Systems · Salary Range: · As per the industry · Company Overview: · Hitachi Astemo Gurugram Powertrain Systems creates clean engine ma ...