C
C#7mo ago
eid

decorator pattern vs adapter pattern

why i make the decorated class implement the same interface of the decorator ,while i don't make the adaptee class implement the same inteface of the adapter?
1 Reply
eid
eid7mo ago
the idea behind adapter pattern is to implement an interface for a class which doesn't implement it??? what the idea behind decorator? a class could be a decorator and an adapter at the same time?? how? decorators add or change behavior!!! i think i can do that with adapter too