CSC/ECE 517 Fall 2010/ch7 7b JB: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 8: | Line 8: | ||
==GRASP== | ==GRASP== | ||
In object-oriented design, the overall problems of assigning responsibility are dealt with by GRASP[http://en.wikipedia.org/wiki/GRASP_%28object-oriented_design%29], or General Responsibility Assignment Software Patterns (or Principles). GRASP has nine principles, of which Information Expert is one. The others are: | In object-oriented design, the overall problems of assigning responsibility are dealt with by GRASP[http://en.wikipedia.org/wiki/GRASP_%28object-oriented_design%29 1], or General Responsibility Assignment Software Patterns (or Principles). GRASP has nine principles, of which Information Expert is one. The others are: | ||
#Creator [http://en.wikipedia.org/wiki/GRASP_%28object-oriented_design%29#Creator] | #Creator [http://en.wikipedia.org/wiki/GRASP_%28object-oriented_design%29#Creator 2] | ||
#Low Coupling [http://en.wikipedia.org/wiki/GRASP_%28object-oriented_design%29#Low_Coupling] | #Low Coupling [http://en.wikipedia.org/wiki/GRASP_%28object-oriented_design%29#Low_Coupling 3] | ||
#High Cohesion [http://en.wikipedia.org/wiki/GRASP_%28object-oriented_design%29#High_Cohesion] | #High Cohesion [http://en.wikipedia.org/wiki/GRASP_%28object-oriented_design%29#High_Cohesion 4] | ||
#Controller [http://en.wikipedia.org/wiki/GRASP_%28object-oriented_design%29#Controller] | #Controller [http://en.wikipedia.org/wiki/GRASP_%28object-oriented_design%29#Controller 5] | ||
#Polymorphysm [http://en.wikipedia.org/wiki/GRASP_%28object-oriented_design%29#Polymorphism] | #Polymorphysm [http://en.wikipedia.org/wiki/GRASP_%28object-oriented_design%29#Polymorphism 6] | ||
#Pure Fabrication [http://en.wikipedia.org/wiki/GRASP_%28object-oriented_design%29#Pure_Fabrication] | #Pure Fabrication [http://en.wikipedia.org/wiki/GRASP_%28object-oriented_design%29#Pure_Fabrication 7] | ||
#Indirection [http://en.wikipedia.org/wiki/GRASP_%28object-oriented_design%29#Indirection] | #Indirection [http://en.wikipedia.org/wiki/GRASP_%28object-oriented_design%29#Indirection 8] | ||
#Protected Variations [http://en.wikipedia.org/wiki/GRASP_%28object-oriented_design%29#Protected_Variations] | #Protected Variations [http://en.wikipedia.org/wiki/GRASP_%28object-oriented_design%29#Protected_Variations 9] | ||
==Process== | ==Process== | ||
Using this approach, the programmer would: | Using this approach, the programmer would: | ||
# Identify a responsibility | # Identify a responsibility | ||
Line 32: | Line 29: | ||
==References== | ==References== | ||
# [http://en.wikipedia.org/wiki/GRASP_%28object-oriented_design%29 Wikipedia's GRASP article] | # [http://en.wikipedia.org/wiki/GRASP_%28object-oriented_design%29 Wikipedia's GRASP article 10] | ||
# [http://cs.armstrong.edu/hsu/Course/CSCI3321/PracticalSoftwareEngineering/html/ch10s04.html Information Expert Pattern overview with diagrams] | # [http://cs.armstrong.edu/hsu/Course/CSCI3321/PracticalSoftwareEngineering/html/ch10s04.html Information Expert Pattern overview with diagrams 11] | ||
# [http://programmersnotes.info/2009/03/28/creator-and-information-expert-grasp-design-pattern-series/#expert Creator and Information Expert Principles with sample code] | # [http://programmersnotes.info/2009/03/28/creator-and-information-expert-grasp-design-pattern-series/#expert Creator and Information Expert Principles with sample code 12] |
Revision as of 04:15, 11 December 2010
Information Expert Pattern
Introduction
Information Expert Pattern is a principle for assigning responsibility in object-oriented design. The fundamental idea is to identify the class with the most information (expertise) and assign responsibility to it.
GRASP
In object-oriented design, the overall problems of assigning responsibility are dealt with by GRASP1, or General Responsibility Assignment Software Patterns (or Principles). GRASP has nine principles, of which Information Expert is one. The others are:
- Creator 2
- Low Coupling 3
- High Cohesion 4
- Controller 5
- Polymorphysm 6
- Pure Fabrication 7
- Indirection 8
- Protected Variations 9
Process
Using this approach, the programmer would:
- Identify a responsibility
- Determine what information is needed to fulfill it,
- Locate where that information is stored
- Identify which class contains the largest subset of the required data
- Assign responsibility to that class
- Assign the responsible class to recursively apply the Information Expert Pattern for acquiring any data still missing.