CSC/ECE 517 Fall 2010/ch7 7d ID: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
Line 16: Line 16:
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 of 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:21, 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:

  1. To assign a responsibility to a class
  2. To avoid or minimize additional dependencies
  3. To maximise cohesion and minimise coupling
  4. To increase reuse and decrease maintenance
  5. 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 for a software system.