CSC/ECE 517 Fall 2010/ch7 7d ID: Difference between revisions
No edit summary |
No edit summary |
||
Line 11: | Line 11: | ||
==What is Indirection Pattern?== | ==What is Indirection Pattern?== | ||
Indirection pattern reduces the coupling between the data objects by setting up an intermediary object which performs the mediation between the objects. The intermediary creates an indirection between the other components. Indirection is utilized by GoF | Indirection pattern reduces the coupling between the data objects by setting up an intermediary object which performs the mediation between the objects. The intermediary creates an indirection between the other components. Indirection is utilized by GoF [http://en.wikipedia.org/wiki/Proxy_pattern proxy], [http://en.wikipedia.org/wiki/Bridge_pattern Bridge], and [http://en.wikipedia.org/wiki/Mediator_pattern Mediator patterns]. | ||
Architectural concepts developed currently for software design and development demand the decomposition of a system into independent modules with well-defined interfaces. This leads to decoupling of data from the rest of the system by hiding the data access details in an abstract interface. To achieve this, it is good to use an intermediate object to mediate between other objects. | Architectural concepts developed currently for software design and development demand the decomposition of a system into independent modules with well-defined interfaces. This leads to decoupling of data from the rest of the system by hiding the data access details in an abstract interface. To achieve this, it is good to use an intermediate object to mediate between other objects. | ||
Indirection pattern describes how the data resources can be exchanged in communication without disrupting the existing application. | Indirection pattern describes how the data resources can be exchanged in communication without disrupting the existing application. | ||
One of the best applications of Indirection pattern is to embed multilingual texts in language-independent data or into software applications. An high level example would be to support multi-languages like English, Spanish, French for user manual for a software system. | One of the best applications of Indirection pattern is to embed multilingual texts in language-independent data or into software applications. An high level example would be to support multi-languages like English, Spanish, French for user manual for a software system. |
Revision as of 04:31, 2 December 2010
Introduction
GRASP(General Responsibility Assignment Software Patterns) in object oriented design gives guidelines for assigning responsibility to classes and objects. Some of the guidelines include the following:
- To assign a responsibility to a class
- To avoid or minimize additional dependencies
- To maximise cohesion and minimise coupling
- To increase reuse and decrease maintenance
- To maximise understandability
There are nine GRASP patterns: Creator, Controller, Pure Fabrication, Information Expert, High Cohesion, Indirection, Low Coupling, Polymorphism and Protected Variations. In this chapter we will look at the Indirection design pattern with some examples.
What is Indirection Pattern?
Indirection pattern reduces the coupling between the data objects by setting up an intermediary object which performs the mediation between the objects. The intermediary creates an indirection between the other components. Indirection is utilized by GoF proxy, Bridge, and Mediator patterns. Architectural concepts developed currently for software design and development demand the decomposition of a system into independent modules with well-defined interfaces. This leads to decoupling of data from the rest of the system by hiding the data access details in an abstract interface. To achieve this, it is good to use an intermediate object to mediate between other objects. Indirection pattern describes how the data resources can be exchanged in communication without disrupting the existing application. One of the best applications of Indirection pattern is to embed multilingual texts in language-independent data or into software applications. An high level example would be to support multi-languages like English, Spanish, French for user manual for a software system.