SlideShare une entreprise Scribd logo
1  sur  17
03 Composite and Flyweight Pattern Design Patterns © Prafulla Paraskar 2010
Composite Structural Design Pattern © Prafulla Paraskar 2010
Definition The composite pattern describes that a group of objects are to be treated in the same way as a single instance of an object.(wikipedia) © Prafulla Paraskar 2010
Composite Pattern – Explained (1/2) © Prafulla Paraskar 2010
Composite Pattern – Explained (2/2) Arranges structured hierarchies so that single components and groups of components can be treated in the same way. Makes easier to add new components. Makes client code simpler, since they do not have to know if they are dealing with one or more components. Typical operations on the components include add, remove, display, find and group. © Prafulla Paraskar 2010
Composite Pattern – UML Diagram © Prafulla Paraskar 2010
Composite Pattern – Real World Samples Files and folders in Windows Organization Tree Arithmetic Expressions like (2 + 4) * ( 5 + 6) Generic containers in .NET framework like list, queue, stack help implement  the composite pattern. © Prafulla Paraskar 2010
Composite Pattern – Guidelines You have : ,[object Object],You Want ,[object Object]
To treat all objects in a composite uniformly.© Prafulla Paraskar 2010
Flyweight Structural Design Pattern © Prafulla Paraskar 2010
Definition The Flyweight pattern is a pattern for sharing objects, where each instance does not contain its own state but stores it externally. This allows efficient sharing of objects to save space when there are many instances but only a few different types. (James W. Cooper – C# Design Patterns) © Prafulla Paraskar 2010
Flyweight Pattern – Explained (1/3) Designing objects down  to the lowest levels of  system "granularity”  provides optimal flexibility , but can be unacceptably  expensive in terms Row objects a p p a r e n t Row objects Character object Column object © Prafulla Paraskar 2010
Flyweight Pattern – Explained (2/3) column row row row a f e d c b g l k j i h Flyweight pool © Prafulla Paraskar 2010
Flyweight Pattern – Explained (3/3) Useful in cases where large number of objects (flyweights)required to provide “fine grain access” to the system.  Characteristics of flyweights are divided into intrinsic (inseparable) e.g. identity and extrinsic (separable) e.g. shared resource. Shared resource is taken care by a directory which manages enrollment  of participant  and provides on demand access to shared resources. Flyweights can only be created with help of a factory to enforce enrollment and sharing of resources.  © Prafulla Paraskar 2010
Flyweight Pattern – UML Diagram © Prafulla Paraskar 2010
Flyweight Pattern – Real World Samples Thumbnail representation of images in windows explorer.  Order processing system where the items are relatively similar and differ only in certain characteristics. Representation of files and folders in windows explorer. Individual cells in a spreadsheet program.  © Prafulla Paraskar 2010
Flyweight Pattern – Guidelines When: ,[object Object]

Contenu connexe

Tendances

Composite Design Pattern
Composite Design PatternComposite Design Pattern
Composite Design Pattern
Raj Chanchal
 
M04 Design Patterns
M04 Design PatternsM04 Design Patterns
M04 Design Patterns
Dang Tuan
 

Tendances (20)

Object oriented modeling
Object oriented modelingObject oriented modeling
Object oriented modeling
 
Encapsulation of operations, methods & persistence
Encapsulation of operations, methods & persistenceEncapsulation of operations, methods & persistence
Encapsulation of operations, methods & persistence
 
Concept of Object Oriented Programming
Concept of Object Oriented Programming Concept of Object Oriented Programming
Concept of Object Oriented Programming
 
Design patterns
Design patternsDesign patterns
Design patterns
 
PATTERNS03 - Behavioural Design Patterns
PATTERNS03 - Behavioural Design PatternsPATTERNS03 - Behavioural Design Patterns
PATTERNS03 - Behavioural Design Patterns
 
Sda 8
Sda   8Sda   8
Sda 8
 
Object database standards, languages and design
Object database standards, languages and designObject database standards, languages and design
Object database standards, languages and design
 
Oops slide
Oops slide Oops slide
Oops slide
 
Oops
OopsOops
Oops
 
Composite Design Pattern
Composite Design PatternComposite Design Pattern
Composite Design Pattern
 
Object oriented programming concept
Object oriented programming conceptObject oriented programming concept
Object oriented programming concept
 
[OOP - Lec 08] Encapsulation (Information Hiding)
[OOP - Lec 08] Encapsulation (Information Hiding)[OOP - Lec 08] Encapsulation (Information Hiding)
[OOP - Lec 08] Encapsulation (Information Hiding)
 
Introduction to Hibernate Framework
Introduction to Hibernate FrameworkIntroduction to Hibernate Framework
Introduction to Hibernate Framework
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Ashish oot
Ashish ootAshish oot
Ashish oot
 
M04 Design Patterns
M04 Design PatternsM04 Design Patterns
M04 Design Patterns
 
Visitor pattern
Visitor patternVisitor pattern
Visitor pattern
 
Oop concepts
Oop conceptsOop concepts
Oop concepts
 
All 23 Design patterns in one page front and back
All 23 Design patterns in one page front and backAll 23 Design patterns in one page front and back
All 23 Design patterns in one page front and back
 
encapsulation
encapsulationencapsulation
encapsulation
 

En vedette

Retail Institution Report
Retail Institution ReportRetail Institution Report
Retail Institution Report
Fridz Felisco
 

En vedette (12)

Flyweight Pattern
Flyweight PatternFlyweight Pattern
Flyweight Pattern
 
Design Patterns - 01 Introduction and Decorator Pattern
Design Patterns - 01 Introduction and Decorator PatternDesign Patterns - 01 Introduction and Decorator Pattern
Design Patterns - 01 Introduction and Decorator Pattern
 
Retail Institution Report
Retail Institution ReportRetail Institution Report
Retail Institution Report
 
Javascript Common Design Patterns
Javascript Common Design PatternsJavascript Common Design Patterns
Javascript Common Design Patterns
 
Command Design Pattern
Command Design PatternCommand Design Pattern
Command Design Pattern
 
Design Patterns - 04 Adapter and Facade Pattern
Design Patterns - 04 Adapter and Facade PatternDesign Patterns - 04 Adapter and Facade Pattern
Design Patterns - 04 Adapter and Facade Pattern
 
Design Patterns - Part 1 of 2
Design Patterns - Part 1 of 2Design Patterns - Part 1 of 2
Design Patterns - Part 1 of 2
 
Command pattern
Command patternCommand pattern
Command pattern
 
Command and Adapter Pattern
Command and Adapter PatternCommand and Adapter Pattern
Command and Adapter Pattern
 
Adapter Design Pattern
Adapter Design PatternAdapter Design Pattern
Adapter Design Pattern
 
Command Design Pattern
Command Design PatternCommand Design Pattern
Command Design Pattern
 
Adapter Design Pattern
Adapter Design PatternAdapter Design Pattern
Adapter Design Pattern
 

Similaire à Design Patterns - 03 Composite and Flyweight Pattern

Software Architecture and Project Management module III : PATTERN OF ENTERPRISE
Software Architecture and Project Management module III : PATTERN OF ENTERPRISESoftware Architecture and Project Management module III : PATTERN OF ENTERPRISE
Software Architecture and Project Management module III : PATTERN OF ENTERPRISE
sreeja_rajesh
 
UML Design Class Diagrams (2014)
UML Design Class Diagrams (2014)UML Design Class Diagrams (2014)
UML Design Class Diagrams (2014)
Miriam Ruiz
 
Design pattern (week 2)
Design pattern (week 2)Design pattern (week 2)
Design pattern (week 2)
stanbridge
 
Applied xml programming for microsoft
Applied xml programming for microsoftApplied xml programming for microsoft
Applied xml programming for microsoft
Raghu nath
 
Assignment # 2PreliminariesImportant Points· Evidence of acad.docx
Assignment  # 2PreliminariesImportant Points· Evidence of acad.docxAssignment  # 2PreliminariesImportant Points· Evidence of acad.docx
Assignment # 2PreliminariesImportant Points· Evidence of acad.docx
jane3dyson92312
 
Part2- The Atomic Information Resource
Part2- The Atomic Information ResourcePart2- The Atomic Information Resource
Part2- The Atomic Information Resource
JEAN-MICHEL LETENNIER
 

Similaire à Design Patterns - 03 Composite and Flyweight Pattern (20)

Design patterns
Design patternsDesign patterns
Design patterns
 
designpatterns-.pdf
designpatterns-.pdfdesignpatterns-.pdf
designpatterns-.pdf
 
UK INCOSE Annual Systems Engineering Conference. Case Study - Implementing TR...
UK INCOSE Annual Systems Engineering Conference. Case Study - Implementing TR...UK INCOSE Annual Systems Engineering Conference. Case Study - Implementing TR...
UK INCOSE Annual Systems Engineering Conference. Case Study - Implementing TR...
 
Remus_3_0
Remus_3_0Remus_3_0
Remus_3_0
 
Software Architecture and Project Management module III : PATTERN OF ENTERPRISE
Software Architecture and Project Management module III : PATTERN OF ENTERPRISESoftware Architecture and Project Management module III : PATTERN OF ENTERPRISE
Software Architecture and Project Management module III : PATTERN OF ENTERPRISE
 
Making your data work harder than you do
Making your data work harder than you doMaking your data work harder than you do
Making your data work harder than you do
 
UML Design Class Diagrams (2014)
UML Design Class Diagrams (2014)UML Design Class Diagrams (2014)
UML Design Class Diagrams (2014)
 
Design pattern (week 2)
Design pattern (week 2)Design pattern (week 2)
Design pattern (week 2)
 
Applied xml programming for microsoft
Applied xml programming for microsoftApplied xml programming for microsoft
Applied xml programming for microsoft
 
Day5
Day5Day5
Day5
 
Assignment # 2PreliminariesImportant Points· Evidence of acad.docx
Assignment  # 2PreliminariesImportant Points· Evidence of acad.docxAssignment  # 2PreliminariesImportant Points· Evidence of acad.docx
Assignment # 2PreliminariesImportant Points· Evidence of acad.docx
 
UML
UMLUML
UML
 
Part2- The Atomic Information Resource
Part2- The Atomic Information ResourcePart2- The Atomic Information Resource
Part2- The Atomic Information Resource
 
QEBU: AN ADVANCED GRAPHICAL EDITOR FOR THE EBUCORE METADATA SET | Paolo PASIN...
QEBU: AN ADVANCED GRAPHICAL EDITOR FOR THE EBUCORE METADATA SET | Paolo PASIN...QEBU: AN ADVANCED GRAPHICAL EDITOR FOR THE EBUCORE METADATA SET | Paolo PASIN...
QEBU: AN ADVANCED GRAPHICAL EDITOR FOR THE EBUCORE METADATA SET | Paolo PASIN...
 
software engineering Design Patterns.pdf
software  engineering Design   Patterns.pdfsoftware  engineering Design   Patterns.pdf
software engineering Design Patterns.pdf
 
Terraform modules restructured
Terraform modules restructuredTerraform modules restructured
Terraform modules restructured
 
Terraform Modules Restructured
Terraform Modules RestructuredTerraform Modules Restructured
Terraform Modules Restructured
 
Ch08
Ch08Ch08
Ch08
 
Ch08
Ch08Ch08
Ch08
 
D0373024030
D0373024030D0373024030
D0373024030
 

Dernier

➥🔝 7737669865 🔝▻ dehradun Call-girls in Women Seeking Men 🔝dehradun🔝 Escor...
➥🔝 7737669865 🔝▻ dehradun Call-girls in Women Seeking Men  🔝dehradun🔝   Escor...➥🔝 7737669865 🔝▻ dehradun Call-girls in Women Seeking Men  🔝dehradun🔝   Escor...
➥🔝 7737669865 🔝▻ dehradun Call-girls in Women Seeking Men 🔝dehradun🔝 Escor...
amitlee9823
 
Editorial design Magazine design project.pdf
Editorial design Magazine design project.pdfEditorial design Magazine design project.pdf
Editorial design Magazine design project.pdf
tbatkhuu1
 
Just Call Vip call girls dharamshala Escorts ☎️9352988975 Two shot with one g...
Just Call Vip call girls dharamshala Escorts ☎️9352988975 Two shot with one g...Just Call Vip call girls dharamshala Escorts ☎️9352988975 Two shot with one g...
Just Call Vip call girls dharamshala Escorts ☎️9352988975 Two shot with one g...
gajnagarg
 
Abortion Pills in Oman (+918133066128) Cytotec clinic buy Oman Muscat
Abortion Pills in Oman (+918133066128) Cytotec clinic buy Oman MuscatAbortion Pills in Oman (+918133066128) Cytotec clinic buy Oman Muscat
Abortion Pills in Oman (+918133066128) Cytotec clinic buy Oman Muscat
Abortion pills in Kuwait Cytotec pills in Kuwait
 
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
kumaririma588
 
How to Build a Simple Shopify Website
How to Build a Simple Shopify WebsiteHow to Build a Simple Shopify Website
How to Build a Simple Shopify Website
mark11275
 
➥🔝 7737669865 🔝▻ dharamshala Call-girls in Women Seeking Men 🔝dharamshala🔝 ...
➥🔝 7737669865 🔝▻ dharamshala Call-girls in Women Seeking Men  🔝dharamshala🔝  ...➥🔝 7737669865 🔝▻ dharamshala Call-girls in Women Seeking Men  🔝dharamshala🔝  ...
➥🔝 7737669865 🔝▻ dharamshala Call-girls in Women Seeking Men 🔝dharamshala🔝 ...
amitlee9823
 
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
amitlee9823
 
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard ...
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard  ...Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard  ...
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard ...
nirzagarg
 
➥🔝 7737669865 🔝▻ Bokaro Call-girls in Women Seeking Men 🔝Bokaro🔝 Escorts S...
➥🔝 7737669865 🔝▻ Bokaro Call-girls in Women Seeking Men  🔝Bokaro🔝   Escorts S...➥🔝 7737669865 🔝▻ Bokaro Call-girls in Women Seeking Men  🔝Bokaro🔝   Escorts S...
➥🔝 7737669865 🔝▻ Bokaro Call-girls in Women Seeking Men 🔝Bokaro🔝 Escorts S...
amitlee9823
 

Dernier (20)

AMBER GRAIN EMBROIDERY | Growing folklore elements | Root-based materials, w...
AMBER GRAIN EMBROIDERY | Growing folklore elements |  Root-based materials, w...AMBER GRAIN EMBROIDERY | Growing folklore elements |  Root-based materials, w...
AMBER GRAIN EMBROIDERY | Growing folklore elements | Root-based materials, w...
 
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...
 
Sector 104, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 104, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 104, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 104, Noida Call girls :8448380779 Model Escorts | 100% verified
 
WhatsApp Chat: 📞 8617697112 Call Girl Baran is experienced
WhatsApp Chat: 📞 8617697112 Call Girl Baran is experiencedWhatsApp Chat: 📞 8617697112 Call Girl Baran is experienced
WhatsApp Chat: 📞 8617697112 Call Girl Baran is experienced
 
➥🔝 7737669865 🔝▻ dehradun Call-girls in Women Seeking Men 🔝dehradun🔝 Escor...
➥🔝 7737669865 🔝▻ dehradun Call-girls in Women Seeking Men  🔝dehradun🔝   Escor...➥🔝 7737669865 🔝▻ dehradun Call-girls in Women Seeking Men  🔝dehradun🔝   Escor...
➥🔝 7737669865 🔝▻ dehradun Call-girls in Women Seeking Men 🔝dehradun🔝 Escor...
 
Hire 💕 8617697112 Meerut Call Girls Service Call Girls Agency
Hire 💕 8617697112 Meerut Call Girls Service Call Girls AgencyHire 💕 8617697112 Meerut Call Girls Service Call Girls Agency
Hire 💕 8617697112 Meerut Call Girls Service Call Girls Agency
 
VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...
VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...
VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...
 
Top Rated Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
 
Editorial design Magazine design project.pdf
Editorial design Magazine design project.pdfEditorial design Magazine design project.pdf
Editorial design Magazine design project.pdf
 
Just Call Vip call girls dharamshala Escorts ☎️9352988975 Two shot with one g...
Just Call Vip call girls dharamshala Escorts ☎️9352988975 Two shot with one g...Just Call Vip call girls dharamshala Escorts ☎️9352988975 Two shot with one g...
Just Call Vip call girls dharamshala Escorts ☎️9352988975 Two shot with one g...
 
Abortion Pills in Oman (+918133066128) Cytotec clinic buy Oman Muscat
Abortion Pills in Oman (+918133066128) Cytotec clinic buy Oman MuscatAbortion Pills in Oman (+918133066128) Cytotec clinic buy Oman Muscat
Abortion Pills in Oman (+918133066128) Cytotec clinic buy Oman Muscat
 
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
 
How to Build a Simple Shopify Website
How to Build a Simple Shopify WebsiteHow to Build a Simple Shopify Website
How to Build a Simple Shopify Website
 
➥🔝 7737669865 🔝▻ dharamshala Call-girls in Women Seeking Men 🔝dharamshala🔝 ...
➥🔝 7737669865 🔝▻ dharamshala Call-girls in Women Seeking Men  🔝dharamshala🔝  ...➥🔝 7737669865 🔝▻ dharamshala Call-girls in Women Seeking Men  🔝dharamshala🔝  ...
➥🔝 7737669865 🔝▻ dharamshala Call-girls in Women Seeking Men 🔝dharamshala🔝 ...
 
Q4-W4-SCIENCE-5 power point presentation
Q4-W4-SCIENCE-5 power point presentationQ4-W4-SCIENCE-5 power point presentation
Q4-W4-SCIENCE-5 power point presentation
 
Top Rated Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...
Top Rated  Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...Top Rated  Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...
Top Rated Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...
 
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
 
Sweety Planet Packaging Design Process Book.pptx
Sweety Planet Packaging Design Process Book.pptxSweety Planet Packaging Design Process Book.pptx
Sweety Planet Packaging Design Process Book.pptx
 
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard ...
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard  ...Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard  ...
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard ...
 
➥🔝 7737669865 🔝▻ Bokaro Call-girls in Women Seeking Men 🔝Bokaro🔝 Escorts S...
➥🔝 7737669865 🔝▻ Bokaro Call-girls in Women Seeking Men  🔝Bokaro🔝   Escorts S...➥🔝 7737669865 🔝▻ Bokaro Call-girls in Women Seeking Men  🔝Bokaro🔝   Escorts S...
➥🔝 7737669865 🔝▻ Bokaro Call-girls in Women Seeking Men 🔝Bokaro🔝 Escorts S...
 

Design Patterns - 03 Composite and Flyweight Pattern

  • 1. 03 Composite and Flyweight Pattern Design Patterns © Prafulla Paraskar 2010
  • 2. Composite Structural Design Pattern © Prafulla Paraskar 2010
  • 3. Definition The composite pattern describes that a group of objects are to be treated in the same way as a single instance of an object.(wikipedia) © Prafulla Paraskar 2010
  • 4. Composite Pattern – Explained (1/2) © Prafulla Paraskar 2010
  • 5. Composite Pattern – Explained (2/2) Arranges structured hierarchies so that single components and groups of components can be treated in the same way. Makes easier to add new components. Makes client code simpler, since they do not have to know if they are dealing with one or more components. Typical operations on the components include add, remove, display, find and group. © Prafulla Paraskar 2010
  • 6. Composite Pattern – UML Diagram © Prafulla Paraskar 2010
  • 7. Composite Pattern – Real World Samples Files and folders in Windows Organization Tree Arithmetic Expressions like (2 + 4) * ( 5 + 6) Generic containers in .NET framework like list, queue, stack help implement the composite pattern. © Prafulla Paraskar 2010
  • 8.
  • 9. To treat all objects in a composite uniformly.© Prafulla Paraskar 2010
  • 10. Flyweight Structural Design Pattern © Prafulla Paraskar 2010
  • 11. Definition The Flyweight pattern is a pattern for sharing objects, where each instance does not contain its own state but stores it externally. This allows efficient sharing of objects to save space when there are many instances but only a few different types. (James W. Cooper – C# Design Patterns) © Prafulla Paraskar 2010
  • 12. Flyweight Pattern – Explained (1/3) Designing objects down to the lowest levels of system "granularity” provides optimal flexibility , but can be unacceptably expensive in terms Row objects a p p a r e n t Row objects Character object Column object © Prafulla Paraskar 2010
  • 13. Flyweight Pattern – Explained (2/3) column row row row a f e d c b g l k j i h Flyweight pool © Prafulla Paraskar 2010
  • 14. Flyweight Pattern – Explained (3/3) Useful in cases where large number of objects (flyweights)required to provide “fine grain access” to the system. Characteristics of flyweights are divided into intrinsic (inseparable) e.g. identity and extrinsic (separable) e.g. shared resource. Shared resource is taken care by a directory which manages enrollment of participant and provides on demand access to shared resources. Flyweights can only be created with help of a factory to enforce enrollment and sharing of resources. © Prafulla Paraskar 2010
  • 15. Flyweight Pattern – UML Diagram © Prafulla Paraskar 2010
  • 16. Flyweight Pattern – Real World Samples Thumbnail representation of images in windows explorer. Order processing system where the items are relatively similar and differ only in certain characteristics. Representation of files and folders in windows explorer. Individual cells in a spreadsheet program. © Prafulla Paraskar 2010
  • 17.
  • 18. Different kinds of state, which can be handled differently to achieve space savings
  • 19. Group of objects that share state
  • 20. Ways of computing some of the state at runtime
  • 21.
  • 22. Thank you! http://geekswithblogs.net/technomad Presentation by Prafulla Paraskar prafulla.paraskar@s1.com © 2010 S1 India Pvt. Ltd. Presentation by Prafulla Paraskar eprafulla@gmail.com © 2010 Prafulla Paraskar