tag:blogger.com,1999:blog-694855878384792308.post1924884753219789260..comments2024-03-21T06:26:49.387-07:00Comments on Java67: Decorator Design Pattern Example in Java [Tutorial]javin paulhttp://www.blogger.com/profile/15028902221295732276noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-694855878384792308.post-89552551464202082172020-01-11T23:58:41.225-08:002020-01-11T23:58:41.225-08:00please tell real example of decorator?please tell real example of decorator?Anonymoushttps://www.blogger.com/profile/04224900218404375031noreply@blogger.comtag:blogger.com,1999:blog-694855878384792308.post-41841288339015228662016-04-16T16:16:30.349-07:002016-04-16T16:16:30.349-07:00And in which exactly real life situation will you ...And in which exactly real life situation will you have to recompile each time you change a price or add a new filling?Adamstylnoreply@blogger.comtag:blogger.com,1999:blog-694855878384792308.post-19078570657397154622015-12-09T21:30:48.173-08:002015-12-09T21:30:48.173-08:00Thanks Javin, and Thanks Ashish too. I was thinkin...Thanks Javin, and Thanks Ashish too. I was thinking how to do multiple customization.Ch!r@Ghttps://www.blogger.com/profile/16206340289549182855noreply@blogger.comtag:blogger.com,1999:blog-694855878384792308.post-68201721346918705532015-01-16T03:01:35.044-08:002015-01-16T03:01:35.044-08:00AbstractFacotry pattern may be a good at aidAbstractFacotry pattern may be a good at aidAnonymoushttps://www.blogger.com/profile/08942993075986106242noreply@blogger.comtag:blogger.com,1999:blog-694855878384792308.post-33579007881798621642014-08-03T11:53:57.556-07:002014-08-03T11:53:57.556-07:00for the beginner who start to learn design pattern...for the beginner who start to learn design pattern this is a great place to learn design patterns with real world example.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-694855878384792308.post-81322509077409015942014-05-25T07:22:54.756-07:002014-05-25T07:22:54.756-07:00Dude Try Some thing like
A Sandwich Class.
Toppi...Dude Try Some thing like <br />A Sandwich Class. <br />Toppings Abstract class with price as methods. And have multiple toppings like Cheese, Grilled, Sauces etc<br />Let Sandwich class has Array of Toppings[]<br />In Sandwich price add base price and Iterate over Toppings array to get price and Add them to sandwich.Ashish Bhargavahttps://www.blogger.com/profile/08255617062785354121noreply@blogger.comtag:blogger.com,1999:blog-694855878384792308.post-3012435511996927122013-08-13T02:38:15.311-07:002013-08-13T02:38:15.311-07:00Decorator Patter is true example of Composition ov...Decorator Patter is true example of Composition over Inheritance. I used it a lot in my code, until I realized that, lots of small classes. Do you know any pattern or Strategy to merge Decorators together to gain benefit of this pattern and negate number of small classes?Georgenoreply@blogger.com