Hence, this design pattern is widely used where memory is a bigger issue than performance and also number of flyweight objects creation is kept under check to reduce the cost in finding correct shared object for any final product object. In this design pattern all kind of shared Flyweight objects were created and then final product object uses one version of flyweight object based in its need which usually costs some performance. Generic model class diagram of Decorator design pattern is as shown in image. For Design patterns basic explanation see ( Design Patterns Simplified Version). The common part of various object is stored and shared via a “Flyweight” object. The other part which varies from object to object will still be part of final object. ![]() ![]() If multiple objects have some internal part as common then all these objects can share these memory to reduce memory consumption. The flyweight design pattern allows to greatly reduce memory footprint of any product by dividing an object into basically two parts.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |