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

Design patterns - Decorator pattern

Jan 15, 2015

Download

Technology

Annamalai C

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.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
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]