CSC/ECE 517 Fall 2010/ch7 7e GS: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
 
Line 1: Line 1:
= Protected Variations Pattern =
= Introduction =
GRASP stands for General Responsibility Assignment Software Patterns and defines nine patterns, of which '''protected variations ''' is one [1].
The protected variations pattern is one of the '''GRASP''' patterns. '''General Responsibility Assignment Software Patterns (or Principles)''', abbreviated GRASP, consists of guidelines for assigning responsibility to classes and objects in object-oriented design.[1]
<blockquote>The protected variations pattern protects elements from the variations on other elements (objects, systems, subsystems) by wrapping the focus of instability with an interface and using polymorphism to create various implementations of this interface.[1]</blockquote>
 
The Protected Variations pattern protects elements from the variations on other elements (objects, systems, subsystems) by wrapping the focus of instability with an interface and using polymorphism to create various implementations of this interface.
 
= Protected Variation Pattern =
This pattern mainly deals with the problem of designing objects, subsystems and systems so that any variations or instability in these elements does not have an undesirable impact on other elements. The Protected Variation pattern tries to address this problem by identifying points of predicted variation or instability and assignsresponsibilities to create a stable interface (or protection mechanism) around them.
 
That is an external object trying to modify another object can only do this by the means of a wrapper which wraps the object to be accesed. Thus this insulates the objects from any changes or variation to other objects.
 
Some of the standard practices motivated by this pattern are '''Data encapsulation, interfaces, polymorphism and indirection.'''
 
== An Example ==
Craig Larman in [2] discusses an example of the Protected Variations Pattern.
 
= Conclusion =
 
= References =
[1] Wikipedia GRASP patterns
 
[2] Protected variation: the importance of being closed, Larman.C, ISSN: 0740-7459, 89 - 91
 
[3] “On the Criteria to Be Used in Decomposing Systems into Modules” Comm. ACM, vol.12, no. 2, Dec. 1972
 
= See Also =

Revision as of 01:17, 2 December 2010

Introduction

The protected variations pattern is one of the GRASP patterns. General Responsibility Assignment Software Patterns (or Principles), abbreviated GRASP, consists of guidelines for assigning responsibility to classes and objects in object-oriented design.[1]

The Protected Variations pattern protects elements from the variations on other elements (objects, systems, subsystems) by wrapping the focus of instability with an interface and using polymorphism to create various implementations of this interface.

Protected Variation Pattern

This pattern mainly deals with the problem of designing objects, subsystems and systems so that any variations or instability in these elements does not have an undesirable impact on other elements. The Protected Variation pattern tries to address this problem by identifying points of predicted variation or instability and assignsresponsibilities to create a stable interface (or protection mechanism) around them.

That is an external object trying to modify another object can only do this by the means of a wrapper which wraps the object to be accesed. Thus this insulates the objects from any changes or variation to other objects.

Some of the standard practices motivated by this pattern are Data encapsulation, interfaces, polymorphism and indirection.

An Example

Craig Larman in [2] discusses an example of the Protected Variations Pattern.

Conclusion

References

[1] Wikipedia GRASP patterns

[2] Protected variation: the importance of being closed, Larman.C, ISSN: 0740-7459, 89 - 91

[3] “On the Criteria to Be Used in Decomposing Systems into Modules” Comm. ACM, vol.12, no. 2, Dec. 1972

See Also