CSC/ECE 517 Fall 2010/ch7 7b jn

From Expertiza_Wiki
Revision as of 02:25, 1 December 2010 by Jkanche (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Information Expert Pattern

INTRODUCTION

There is always a problem of assuming which object should be given a responsibility and this is where information expert pattern comes into play. we assign responsibilities to classes during the design phase and information expert helps us decide which responsibility should be given to a class.

Information Expert is defined as : Assign a responsibility to the information expert; the class that has the information necessary to fulfill the responsibility.

we need to analyze how much effect Information expert causes to cohesion and coupling before deciding the pattern for the class.

PATTERN

A pattern describes a problem which occurs over and over again in our environment, and then describes the core of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it the same way twice

In a nutshell, the principle of Information Expert is to assign responsibilities and to look at a given responsibility, determine the information needed to fulfill it, and then determine where that information is stored.Then, Information Expert will lead to placing the responsibility on the class with the most information required to fulfill it.

GRASP

GRASP stands for General Responsibility Assignment Software Pattern Describe fundamental principles of object design and responsibility and is expressed in patterns. Information Expert in one of the five GRASP Patterns, viz. Creator, Information Expert, Low Coupling, Controller and High Cohesion.

RESPONSIBILITY DRIVEN DESIGN (RDD)

  • A way of thinking about OOD:
  1. Responsibilities
  2. Roles
  3. Collaborations
  • Common responsibility categories:
  1. Doing:
    1. Doing something itself:
      1. Creating and object or doing a calculation
    2. Initiating action in other objects
    3. Controlling and coordinating activities in other objects
  2. Knowing:
    1. Knowing about private data
    2. Knowing about related objects
    3. Knowing about things it can derive or calculate
    4. Bigger responsibilities may take several classes
  • Guideline:
  1. Domain model helps with “knowing”
  2. Interaction diagrams help with “doing”