Design pattern decorator and java implementation

what is the problem The design pattern decorator is used in this case: i have some object and i want to add responsability. what is the solution of decorator To solve this problem i can use inheritance, but as we know the inheritance has some drawback and is to prefer composition over inheritance. Alternative solution is the decorator design pattern that use composition. Practically the decorator is a wrapper for the object whereto i want add responsability. The advantage of this pattern is that we can add responsability at run-time, we can easily combine them and we can add responsability at some object or all. To do that we don't have violate some bacis software design principles as SRP and OCP. Pizza example class diagram in this example i want add to some object of type PizzaSimple a ham or a fungus or both. When i do that i have to change the name of pizza and his price. The key point of this pattern is the decorator class that contain another object of type Pizz...