FlyweightFactory: It's a factory class used by a client class to get the data from the concreate flyweight. IFlyweight: Basic contract to be implemented by derived types, in other words by concrete flyweight.The following image shows the class diagram of the basic Flyweight Design Pattern. Ultimately flyweight patterns make the application efficient in terms of memory and processing.īasic UML class Diagram of Design Pattern Causes the application to consume less memory, since the object already exists in memory and no new object must be created because of the pool.Increases application performance in terms of object creation since there is no requirement of creating an object for every request.So this pattern does the following two things because the pattern creates objects once and then saves them to a pool: The Flyweight Pattern is about creating a pool of objects that allows sharing already existing objects and causing the application to consume less memory. The Flyweight Design Pattern is one of the structural patterns introduced by the GOF.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |