CSC/ECE 517 Fall 2010/ch7 7d ID: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
==Introduction== | ==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: | 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 assign a responsibility to a class | ||
# To avoid or minimize additional dependencies | # To avoid or minimize additional dependencies | ||
Line 9: | Line 9: | ||
There are nine GRASP patterns: | 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. | 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.[http://en.wikipedia.org/wiki/Model%E2%80%93View%E2%80%93Controller MVC] is a classic example of indirection pattern where the controller is the intermediary, base components being Model and view. | |||
==Why Indirection Pattern?== | |||
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 of a software system. |
Revision as of 04:16, 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.MVC is a classic example of indirection pattern where the controller is the intermediary, base components being Model and view.
Why Indirection Pattern?
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 of a software system.