Questions tagged [adapter]
The adapter tag has no summary.
25 questions
0 votes
4 answers
674 views
Adapter or pure interfaces?
I got a bit strange 'future ready' scenario. And I'm not sure if I got it right in regards to C# adapter design pattern. The scenario is that to be future ready, 'to use the adapter pattern' to easily ...
1 vote
1 answer
122 views
Adapt very different adapters to an Interface
I'm building a service to send push notifications to the user. At first, I designed an Interface for the push notification adapters, something like this: interface PushNotificationAdapterInterface { ...
2 votes
1 answer
184 views
Is this a valid GoF Adapter example?
After visit dozens of pages searching a "non-sockets-or-iphone-conceptual-example" of Adapter Pattern, I have found this one: Lloyds bank is an international bank offers services worldwide. For ...
0 votes
1 answer
168 views
Is a JSON wrapper an adapter?
Please let me illustrate with a simple example. Suppose we have a Weather object: class Weather: def get_forecast(self, day, place): forecast = "code that calculates forecast" ...
2 votes
1 answer
610 views
Is an Adapter pattern a Proxy pattern? If not, why not?
A common use of the adapter pattern is to support functionality that isn't actually supported in an underlying class. For example, if I use an API to interact with a Samsung Smart TV, I might want to ...
1 vote
1 answer
5k views
How to name different components in adapter pattern?
(example code in PHP, but this can apply to more languages) I have a scenario with an adapter pattern, where I have classes, interfaces and objects with different roles, like so: An original object ...
7 votes
1 answer
790 views
I need to be able to adapt my type to theirs, and theirs to mine
I have a situation where I have an external library. In short, I need to be able to adapt my type to theirs, and theirs to mine. The library has a collection like so: interface IExternalCollection { ...
2 votes
1 answer
5k views
What is the difference between Adapter and Delegation design pattern?
I am very confused about Adapter and Delegation design pattern. In Adapter pattern we bring an intermediate class to interact with another class. And in Delegation pattern we also bring an ...