design patterns - decorator pattern

8
DECORATOR PATTERN explained ! Prepared by Annamalai Copyright 2006-2011 QmPe initiative

Upload: annamalai-c

Post on 15-Jan-2015

789 views

Category:

Technology


1 download

DESCRIPTION

This presentation is part of the Design Pattern Series. Presentation explains the use of Decorator Pattern comparing it against a real life situation and then showcasing the Java implementation of the same.

TRANSCRIPT

Page 1: Design patterns -   Decorator pattern

DECORATOR PATTERN explained !

Prepared by Annamalai C

Copyright 2006-2011

QmPeinitiative

Page 2: Design patterns -   Decorator pattern

Copyright 2006-2011

Decorator Pattern in Real Life

DecoratesDosa

Page 3: Design patterns -   Decorator pattern

Copyright 2006-2011

Decorator Pattern in Java

DecoratorClient

Component Decorator

Concrete Component Concrete Decorator

Page 4: Design patterns -   Decorator pattern

Copyright 2006-2011

Real Life vs Java Object

Component

Concrete Component

Page 5: Design patterns -   Decorator pattern

Copyright 2006-2011

Real Life vs Java Object

Component Decorator

Concrete Decorator

Page 6: Design patterns -   Decorator pattern

Copyright 2006-2011

How Decorator Pattern works in Real Life ?

1 Orders a Dish from Menu

2Receives the Name of the DishCreates the Dish

3 Delivers the Dish

makes

decorates

Page 7: Design patterns -   Decorator pattern

How Decorator Pattern works in Java ?

Copyright 2006-2011

Page 8: Design patterns -   Decorator pattern

Copyright 2006-2011

QmPeinitiative

THANK YOU

Please visit www.eclipseinclips.com | www.ancitconsulting.com

Write to us on [email protected]