SOFTWARE ARCHITECTURES UNIT-7LECTURE-47

1 Structural Decomposition :

Design patterns systematically names, explains and evaluates an important and recurring design in object-oriented systems. Their main objective is to reuse successful designs and architectures of experienced and professional designers. Structural design patterns relate to class and object composition. They use inheritance to compose interfaces and define ways to compose objects to obtain new functionality.

The design patterns in this group further emphasize and clarify the fundamental differences

7.2 whole-Part :

In this there will be two parts. The structure of whole and part are shown below :

Class: Whole

Responsibility:

•Aggregates several smaller objects

•Provides services built on top of part objects

•Acts as a wrapper around its constituent parts

Collaborators: Part

Class: Part

Responsibility:

•Represents a particular object and its services

Collaborators: - Nil

•Whole object: It is an aggregation of smaller objects

•The smaller objects are called Parts

Whole object forms a semantic grouping of its Parts in that it coordinates and organizes their collaboration

The Whole uses the functionality of Parts objects for implementing services

Implementation

1.Design the public Interface of the Whole

2.Separate the Whole into Parts, or make it from existing ones (Use either bottom- up, topdown or both mixed)

3.Use existing Parts from component libraries or class libraries or package, specify their collaboration if you use bottom-up approach

4.Partition the Whole's services into smaller collaborating services and map these collaborating services to separate Parts if you follow a top-down approach

5.Specific the services of the Whole in terms of services of the Parts

6.Implement the Parts (Recursively if Parts are not leaf)

7.Implement the Whole by putting all the Parts together

Advantages

Changeability of Parts

Reusability

Defines class hierarchies consisting of primitive objects

Makes the client simple

Makes it easier to add new kinds of components

Disadvantages

1)Makes your design overly general

2)Lower efficiency through indirection

3)Complexity of decomposition into Parts might be an art

DEPARTMENT OF CSE/ISE NAVODAYA INSTITUTE OF TECHNOLOGY RAICHUR