Linked Questions
26 questions linked to/from How do the Proxy, Decorator, Adapter, and Bridge Patterns differ?
36 votes
2 answers
33k views
Design Patterns - Adapter pattern vs Decorator Pattern? [duplicate]
I have been reading about design patterns and this got me curious: Decorator Pattern says wrap an original object and add additional features in the wrapper object. So structurally speaking - ...
176 votes
13 answers
100k views
When to use the Bridge pattern and how is it different from the Adapter pattern?
Has anyone ever used the Bridge pattern in a real world application? If so, how did you use it? Is it me, or is it just the Adapter pattern with a little dependency injection thrown into the mix? Does ...
249 votes
17 answers
265k views
What is a wrapper class?
What is a wrapper class? How are such classes useful?
220 votes
10 answers
71k views
Differences between Proxy and Decorator Pattern
Can you give any good explanation what is the difference between Proxy and Decorator? The main difference I see is that when we assume that Proxy uses composition and Decorator uses aggregation then ...
179 votes
10 answers
84k views
Difference between Bridge pattern and Adapter pattern
What is the difference between the Bridge and Adapter patterns?
88 votes
8 answers
51k views
When to Use the Decorator Pattern?
I am going over my design patterns, and one pattern I have yet to seriously use in my coding is the Decorator Pattern. I understand the pattern, but what I would love to know are some good concrete ...
83 votes
3 answers
30k views
What are the differences between proxy, wrapper or a façade classes
What are the differences between proxy, wrapper or a façade classes They all seem to be the same to me, they take an implementation, encapsulate it and then methods are called on the wrapper/proxy/...
34 votes
2 answers
25k views
What are the differences between Decorator, Wrapper and Adapter patterns?
I feel like I've been using these pattern families quite many times, however, for me it's hard to see the differences as their definitions are quite similar. Basicaly it seems like all of them is ...
36 votes
3 answers
28k views
What is the exact difference between Adapter and Proxy patterns?
As I understood both Adapter and Proxy patterns make two distinct/different classes/objects compatible with each for communication. And both of them are Structural patterns. I am getting that both of ...
8 votes
3 answers
3k views
What pattern is used in Collections.synchronizedList()
I was reading the implementation of method Collections.synchronizedList() and was confused whether its an example of decorator pattern or a proxy pattern?
3 votes
5 answers
2k views
Wrapping C# classes to use with polymorphism through a common interface
I've got several C# classes each with similar properties. (They're part of an SDK and their code can’t be changed.) Person.Name Product.Name Order.Name I want to use these classes polymorphically, but ...
4 votes
4 answers
4k views
Is a proxy class the same as a class wrapper?
I have to access a legacy database that has "generic" tables in it and I do not have the authority to change it. Depending on the customer data that I'm working with, the relationships between the ...
2 votes
4 answers
3k views
adapter pattern and dependency
I have little doubt about adapter class. I know what's the goal of adapter class. And when should be used. My doubt is about class construction. I've checked some tutorials and all of them say that I ...
5 votes
3 answers
3k views
In C#, should I use struct to wrap an object in order to fulfill additional interfaces?
There is an existing class from a third-party library I want to reuse, but it does not implement some of the required interfaces. I'm thinking of wrapping it inside a struct to fulfill the required ...
6 votes
2 answers
2k views
Is there a name for this design pattern (dynamically wrapping around another class)?
Suppose I have a class uicontrolWrapper, which is a wrapper for a uicontrol (but does not subclass it). The uicontrol stuff is kept in a private property for uicontrolWrapper. Basically, I want to be ...