Powered by Blogger.
Showing posts with label Decorative. Show all posts
Showing posts with label Decorative. Show all posts

Decorator Design Pattern with an Example

>> Monday, May 30, 2011

Definition:
               Attach additional responsibilities or functions to an object dynamically or statically. Also known as Wrapper.
Where to use & benefits:
  1. Provide an alternative to subclassing.
  2. Add new function to an object without affecting other objects.
  3. Make a responsibility easily added and removed dynamically.
  4. More flexibility than static inheritance.
  5. Transparent to the object.
  6. Related patterns include  
Decorative Design Pattern with Example_JavabynataraJ
  •  Adapter pattern, which provides a different interface to the object it adapts, whereas a decorator changes an object's responsibilities,

Read more..

Related Posts Plugin for WordPress, Blogger...
© javabynataraj.blogspot.com from 2009 - 2022. All rights reserved.