Quantcast
Channel: Rss Feed IntellyNeT
Viewing all articles
Browse latest Browse all 13

Design pattern decorator and java implementation

$
0
0
AddThis Social Bookmark Button
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.

Viewing all articles
Browse latest Browse all 13

Trending Articles