Nice link Steve. Thanks!
Thanks Ilja. If I understood correctly you are proposing to have a different name for condiment that seems like beverage, to map it with real model.
I doubt it is always clear.
Say, I have a Room interface and ConferenceRoom component class implementing Room. Some client code is expecting Room somewhere...
Now I want to decorate ConferenceRoom with Painting (a decorator class).
What can be the name of Painting so it seems like Room? A PaintedRoom? Yes, it seems like Room but doesn't seem like Painting, which it is actually.
My point is, somewhere we are compromising in mapping it with real model.
Also, say if some other client code is using Painting class (away from decorator), for example: Rick draws paintings
class Rick {
Painting[] ownPaintings = null;
}
Now after applying decorator pattern, how it will look:
class Rick {
PaintedRoom[] ownPaintings = null;
}
This again confuses other developers, what�s going on here???
Thanks.