CSC/ECE 517 Fall 2010/ch1 2b dg: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 27: Line 27:
A CRC model is usually created by an individual or small group of designers during the early phase of an object-oriented development project.The figure shows the design of hierarchy of classes. These set of class used for drawing objects are shown. We can see TShape class has a superclass called TObject and two subclasses, TBox and TCircle. Lets assume we create new class TWindow derived from the superclass TObject.  [[Image:Design.png|thumb|Description]]
A CRC model is usually created by an individual or small group of designers during the early phase of an object-oriented development project.The figure shows the design of hierarchy of classes. These set of class used for drawing objects are shown. We can see TShape class has a superclass called TObject and two subclasses, TBox and TCircle. Lets assume we create new class TWindow derived from the superclass TObject.  [[Image:Design.png|thumb|Description]]


<b>2)Assign Responsibilities</b>
<b>2) Assign Responsibilities</b>


Once a set of classes are defined, behaviors can be assigned that will provide the functions of the application. For example, the TShape card has responsibilities Initialize to create it and Draw to illustrate it on the diagram.
Once a set of classes are defined, behaviors can be assigned that will provide the functions of the application. For example, the TShape card has responsibilities Initialize to create it and Draw to illustrate it on the diagram.

Revision as of 15:28, 22 September 2010

Introduction

CRC Cards also known as Class-Responsibility-Collaboration cards are a brainstorming tool to enable collaboration across different teams or individuals in contribution to design, usually used in Object Oriented Software development. This was proposed by Ward Cunningham and Kent Beck[1]. The CRC card can be viewed as an index card, with the following details:

CRC Card Structure
  • The Top of the card usually bears the name of the class.
  • The Left side of the card has the responsibilities of the class.
  • The Right side of the card has the collaborating classes corresponding to each of the responsibilities listed in the left side.

Thus in general, a CRC session can be viewed as the interaction between a set of collaborating classes for a particular Use case.

According to [2]A CRC session proceeds with someone simulating the system by talking about which objects send messages to other objects. By stepping through the process weaknesses and problems are easily uncovered. Design alternatives can be explored quickly by simulating the design being proposed.

A CRC Example

To better understand how the CRC cards work together, let us consider an example.

Why need a Software for CRC Cards

CRC cards are limited by their scope. If we go about designing a huge project, the scope spans many classes and interactions between them. The tedious task of maintaining are CRC cards and to properly formulate interaction can get overwhelming. Following reasons propel use for software for CRC Cards :

  • Designing Scenario: A scenario represents series of steps in which classes and objects communicate. There are be references to other cards or scenarios.
  • Modeling : Software provide an easy way to segregate cards and objects into different diagrams. Thus we can model our software with different functionality very easily.
  • Simulation : Software can provides simulation of an software design. This might include single stepping backwards, forwards a scenario or jumping to a specific location in the scenario stack of a multiple scenario simulation
  • Synchronization and Dependencies: Software can maintain relationships between cards, scenarios as design changes take place. If a card references other cards or classes, those cards are generated automatically. Also any name changes and cross references between objects are instantly updated.
  • Revision history and Version Control : Software for CRC cards supports changes to CRC cards. It is easy to model and keep track of all changes to a CRC cards. This is extremely helpful in realizing the design changes to CRC cards.

Desining Software

The following steps proceed while designing Software for CRC cards:

1) Create CRC Cards

A CRC model is usually created by an individual or small group of designers during the early phase of an object-oriented development project.The figure shows the design of hierarchy of classes. These set of class used for drawing objects are shown. We can see TShape class has a superclass called TObject and two subclasses, TBox and TCircle. Lets assume we create new class TWindow derived from the superclass TObject.

Description

2) Assign Responsibilities

Once a set of classes are defined, behaviors can be assigned that will provide the functions of the application. For example, the TShape card has responsibilities Initialize to create it and Draw to illustrate it on the diagram.

3) Add Attributes

Attributes of classes may also be identified in a CRC Card.The TShape class has attributes fPosition, fType and fSelected.

4) Define Scenario

A scenario describes a sequence of steps in the design using the responsibilities of a group of collaborating classes. Collaboration between classes refers to a client object that uses a responsibility performed by a server object. Often a class must call upon several collaborating classes to implement one of its responsibilities.A scenario describes what happens in the system from a high-level, user point of view.

References

[1] A Laboratory For Teaching Object-Oriented Thinking: http://c2.com/doc/oopsla89/paper.html

[2] CRC Cards: http://www.extremeprogramming.org/rules/crccards.html

[3]


See Also

External Links