Manipulates objects in the composition through the component interface.Implements child related operations in the component interface.Defines behavior for components having children.Defines behavior for primitive objects in the composition.Represents leaf objects in composition.Declares an interface for accessing and managing its child components.Implements default behavior for the interface common to all classes as appropriate.Declares interface for objects in composition.Let's see the 4 elements of composte pattern. UML for Composite Pattern Elements used in Composite Pattern: Where the responsibility of object may vary from time to time. When the responsibilities are needed to be added dynamically to the individual objects without affecting other objects.When you want to represent a full or partial hierarchy of objects.It provides flexibility of structure with manageable class or interface.It makes easier to you to add new kinds of components.It defines class hierarchies that contain primitive and complex objects.A Composite Pattern says that just "allow clients to operate in generic manner on objects that may or may not represent a hierarchy of objects".
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |