CSC/ECE 517 Fall 2011/ch4 4i sd

From Expertiza_Wiki
Jump to navigation Jump to search

"CRC Card Tools"


Introduction

CRC Cards are the Class Responsibility Collaboration Cards which is a useful way to document collaborative design decisions. CRC Cards were invented by Kent Back and Ward Cunningham in 1989 as an approach for teaching object-oriented design.<ref name="paper"> Beck, Kent; Cunningham, Ward (October 1989), "A laboratory for teaching object oriented thinking", ACM SIGPLAN Notices (New York, NY, USA: ACM) 24 (10): 1–6, doi:10.1145/74878.74879, ISBN 0-89791-333-7</ref> Cunningham arrived at classes, responsibilities and collaborators as the essential dimensions of an object oriented model.<ref name="nancy">Nancy M. Wilkinson, "Using CRC Cards: An Informal Approach to Object-Oriented Development", ISBN 0-13-374679-8</ref> The intention was to come up the essential units of abstraction for the object-oriented approach analogous to the notions of processes, data flows, and data stores for procedural designs.<ref name="nancy" /> This wiki article will discuss about CRC cards, how they are made and a few software tools that are used to implement CRC cards.

CRC Cards

CRC Cards are the Class Responsibility Collaboration Cards which are used to interactively brainstorm an initial design of a program or a program segment. These are used as a tool used in the design on object oriented software.<ref name="crc">CRC Cards - Wikipedia</ref> It supports a rapid and thorough exploration of design alternatives. It is used during initial model construction as a brainstorming technique where it is used to determine which classes are needed and how they will interact among themselves, and again later to evaluate the design. Normally, it could be done by one person or may require up to five people.<ref name="alistair">CRC Cards</ref>

CRC cards explicitly represent multiple objects simultaneously. However, rather than simply tracing the details of a collaboration in the form of message sending, CRC cards place the designer’s focus on the motivation for collaboration by representing (potentially) many messages as a phrase of English text.<ref name="paper"></ref>


CRC Card

Description of CRC

The CRC cards are commonly created from 4 by 6 inch index cards and they contain:

  • Class - the name of the object-oriented class
  • Responsibility - the responsibilities of the class
  • Collaborator - the relationship the class has with other classes in order to collaborate and fulfil its responsibilities

To identify the name of the classes, we look for the nouns in the requirements document. The class should be a singular noun, does not really have the same functionality as some other class, and is not a primitive type.

Responsibility-driven modelling can be done using CRC cards. These could also be used to form object interaction diagram. The advantage of using a small index card is that they are cheap, portable, readily available, and familiar.<ref name="paper" /> Since these cards are small in size, they help reduce the complexity of the design to minimum. It focuses the designer on the essentials of the class and prevents her/him from getting into its details and inner workings at a time when such detail is probably counter-productive. It also forces the designer to refrain from giving the class too many responsibilities. Because the cards are portable, they can easily be laid out on a table and re-arranged while discussing a design with other people.

Steps in making CRC Cards

  1. Identify and assign candidate classes
  2. Determine a set of specific scenarios
  3. Walk through the scenario, naming cards and responsibilities
  4. Write the main responsibility for each class
  5. Identify the responsibilities for each class
  6. Identify one or more collaborators for each class

Then, essentially, these index cards become your class diagram. In your class diagram, you create a class for each card that was used. The responsibilities on the card become the method of the class. All collaborators indicate that an association between the two classes must be drawn (and the class will need to have an instance of the collaborating classes). Finally, the data members on the back of the card become the attributes of the class. You’ll probably need to make some adjustments to this initial design – for example recognizing and handling inheritance – but its usually a great start!

Example of a CRC Card

Here is an example of how a CRC Card looks.<ref name="dennis">Dennis, Wixom, Roth, "Systems Analysis and Design", 3rd Edition</ref> The CRC card here is for a Patient class. The Description of the class indicated the main responsibility associated with the class. Along with this information, the other responsibilities performed by this class is indicated in a separate Responsibilities section. If a collaborator is required to perform the responsibilities of the class, the name of the collaborator class is indicated in the Collaborators section associated with a particular responsibility. The back side of the card essentially displays the Attributes of the class and the Relationships of the class with other classes.

  • Front Side of a CRC Card

Front Side of a CRC Card

  • Back Side of a CRC Card

Back Side of a CRC Card

Advantages of CRC cards

  • The experts do the analysis: The people who understand the problem domain, the business domain experts (BDEs) are the people who create the model.<ref name="advantages">Scott W. Ambler (November 29, 1998), "CRC Modeling: Bridging the Communication Gap Between Developers and Users", An AmbySoft Inc. White Paper</ref>
  • User participation increased: Users are actively involved in defining the model and thus increases their participation in understanding the system and creating it.
  • Breaks down communication barriers: Users and developers work togther side-by-side to create the CRC model.<ref name="advantages" />
  • Simple and Straightforward: CRC cards are easy to fill out and provide the essence of the system in a simple and straightforward manner.
  • Portable: CRC cards are easy to use and can be used anywhere.
  • Prototyping: CRC modeling and prototyping are both iterative processes in which users are greatly involved. It is very common to draw rough sketches of screens and reports during CRC modeling sessions.<ref name="advantages" />
  • Formal Analysis: CRC cards provide a basis for more formal analysis and design mathodologies.
  • Class Diagrams: Class diagrams can be generated based on the CRC cards.
  • Life Cycle: CRC cards are useful throughout the life cycle.
  • Transition: CRC cards eases the transition from process orientation to object orientation.

Disadvantages of CRC cards

  • Inefficient for larger systems: For a larger system, there are many classes and maintaining all of them becomes difficult especially if there are many dependencies. Hence, CRC cards tend to prove inefficient and time consuming while modelling larger systems.
  • Limited Details: CRC cards provide limited details about the software elicitation because of the high level abstraction.<ref name="disadvantages">Mr. Sham-Ul-Arif, Mr. Qadeem Khan, S. A. K. Gahyyur, "Requirements Engineering Processes, Tools/Technologies, & Methodologies, International Journal of Reviews in Computing, ISSN: 2076‐3328</ref>
  • Threatening to some developers: Too many developers do not recognize the need for working closely with users, thinking that because they know the technology they also understand the business domain. This belief is obviously false, the users who do the job day in and day out almost always know more about it than the developers.<ref name="disadvantages" />
  • Hard to get users together: To schedule people for CRC modelling is difficult.
  • CRC cards are limited: CRC models are just part of the definition of user requirements for an OO application and one must also consider use cases, prototypes, and formal requirements documents. Furthermore, in most organizations it isn’t acceptable to simply submit a collection of index cards as your analysis deliverable.<ref name="disadvantages" />

CRC Card Tools

There are a couple of CRC card tools available which are implemented in software packages to help users manage the different stories.

QuickCRC

QuickCRC is a tool developed by Excel Software for responsibility driven design of object-oriented software using CRC cards. CRC cards are used to discover and document classes, responsibilities, attributes and collaborations between classes. Design scenarios can be identified and simulated. Complex designs can be partitioned into multiple diagrams with easy navigation through a contents view. The inheritance graph automatically shows the class structure of the evolving design. The user can assign the attribute access of each card responsibility and the tool presents an attribute access graph.<ref name="quickcrc1">QuickCRC Tool</ref> This tool is available for both Windows and Mac OS X.

QuickCRC Tool CRCs Card drawn using QuickCRC

The features of QuickCRC<ref name="quickcrc2">QuickCRC by Excel Software</ref> are:

  • Cards and scenario objects can be drawn in the diagram workspace. Each card has a class name, description, superclasses, subclasses, attributes, responsibilities and collaborating objects.
  • The card information is entered through a dialog or edit on-screen by dragging or renaming cards, attributes, responsibilities and collaborations.
  • Assign the attribute access of each card responsibility. Also shows an attribute access graph from the card information to help developers discover, refine and eliminate unnecessary card attributes.
  • Scenarios can reference cards or other scenarios.
  • Cut and paste cards and scenarios between diagrams or projects.
  • Allows a designer to navigate between diagrams shown as folder icons that can be opened or closed. A card or scenario can be dragged between diagrams or double-clicked to edit its properties making it easy to locate and modify information as the model grows.
  • Provides active simulation of an evolving design.
  • Maintains relationships between cards, scenarios and external agents as fluid design changes take place. If a card references undefined subclasses or superclasses, those cards are generated automatically.
  • Model other relationships between cards like aggregation and interface implementation.
  • Name changes and cross references between objects are instantly updated.
  • Has a rich search feature for locating design data within specific fields of any card or scenario in the project.

This software tool runs best on Windows XP, Vista or 7 with 1 GB RAM. The package includes both a Standard and Lite edition. The only difference between these two editions is the amount of data that a project can hold and the memory requirements of your machine.<ref name="quickcrc2" />

Software Ideas Modeler

Software Ideas Modeler is a lightweight and powerful CASE tool by Dusan Rodina. It supports UML 2.2 diagrams and a lot of other ones. Software Ideas Modeler is freeware (for non-commercial use). Commercial user may use this software only after buying a license.<ref name="modeler">Software Ideas Modeler</ref>


A sample CRC card in Software Ideas Modeler


This tool is fairly simple to use and also allows the user to customize the card properties. It supports various types of automatic alignment for diagram elements. Diagram can be zoomed. There are also implemented standard functions as undo/redo and work with clipboard. Diagram elements can be styled (background color, text color, fonts, border), grouped, placed in layers. The tool also provides an additional feature of including the subclasses and superclass of the class in discussion. Every field value can be modified and renamed inline. This tool also provides a feature of customizing the text and style based on the class. The interesting feature of this tool is that one can attach comments to a CRC card and also link the comments along with the comments. One can also attach a Diagram Description to a card.

There is an export to raster image formats (BMP, GIF, JPG, PNG, TIFF), vector image formats (Windows Metafile, SVG) and PDF. There is also export to XML. There is an import from XML.<ref name="simwiki">Software Ideas Modeler - Wikipedia</ref> It also provides support for various languages. The application supports also style sets for the whole project. The diagrams can be exported to multiple image formats and vector formats like WMF, EMF, SVG and bitmap format PNG. Very useful features of Software Ideas Modeler can be automatic scrolling, symbolic editing of elements or automatic size adjustment of the elements. The tool has support for source code generation for languages like C#, VB.NET, SQL DDL.

Visual Paradigm

Visual Paradigm for UML (VP-UML) is a UML CASE Tool supporting UML 2, SysML and Business Process Modeling Notation (BPMN) from the Object Management Group (OMG). In addition to modeling support, it provides report generation and code engineering capabilities including code generation. It can reverse engineer diagrams from code, and provide round-trip engineering for various programming languages.<ref name="visual">Visual Paradigm for UML</ref>


Visual Paradigm Tool with a sample CRC Card CRC Card with inline editing


Class-Responsibility Collaborator (CRC) card is designed for identifying classes and operations in object-oriented approach. Visual Paradigm for UML provides a CRC Card diagram for software team to brainstorm, records, analyze and maintain CRC cards in systematic and collaborative way. This tool is very easy to use and intuitive. It allows easy addition of responsibilities to a class. Along with this, all fields on a crd can be edited inline. Visual paradigm is a simple diagram tool. The CRC diagrams in the tool are not linked to the sequence diagrams. This tool can be integrated with Eclipse/IBM WebSphere, Borland, JBuilder, NetBeans IDE, IntelliJ IDEA, Oracle JDeveloper and BEA WebLogic Workshop to support the implementation phase of software development. The transitions from analysis to design and then to implementation are seamlessly integrated within the CASE tool, thus significantly reducing efforts in all stages of the software development lifecycle.<ref name="tools">Visual Paradigm</ref>

CRC Design Assistant

The CRC Design Assistant was first conceived to assist students in creating real-world software applications in the context of the software engineering course at UTEP. This tool helps in visualizing the design, tracking design changes, maintaining the list of system responsibilities when classes are removed, revising documentation when designs change, and presenting a design to other team members and observers.<ref name="design">Steve Roach, Department of Computer Science, University of Texas at El Paso, Javier C Vásquez, Department of Computer Science, University of Texas at El Paso, "A Tool to Support the CRC Design Method", October 2004</ref>


CRC Design Assistant Tool CRC Card View


The characteristics of this tool are:

  • Supports the CRC design method and assist students in creating, modifying, and documenting
  • Helps in creating object-oriented designs
  • Helps maintain a class hierarchy of the different classes (cards) that are created for a subsystem
  • Provides a drag and drop feature where the responsibilities could be selected and dragged in the subsystem or class list
  • Draws lines to indicate collaborator classes making it visually easy to understand and correlate
  • Supports a team environment and is accessible over the internet
  • Allows the ability to track changes made by each team member
  • Generates a design documentation in the form of RTF files and diagrams
  • Stores the entire design in a single database

The tool is fairly simple and easy to maintain.

EasyCRC Tool

One of the less popular tool is the Easy CRC tool which makes use of the .NET Framework. This tool divides the task of making CRC cards into two stages. The first stage is identifying the objects from a definition which is a plain text and then identifying the responsibilities and collaborators for the identified responsibilities by simulating scenarios through sequence diagrams.<ref name="easy">EasyCRC Tool</ref>


Easy CRC Tool


Editing the CRC cards using the CRC card editor can be done in different ways. One method is to enter all information manually - editing the different values through the property editor in the tool. Right-click the “CRC cards” node in the solution explorer; a sub menu will be displayed with an option to add an item to the sub tree below. In this manner the user can Assign Responsibilities, Add Attributes, Add Methods to responsibilities and set the different properties of the item. Another way is to create sequence diagrams and from them, the collaborators and responsibilities of the CRC cards would be discovered automatically.<ref name="easypaper">"Easy CRC Tool - Description Paper"</ref> This tool also has an option to export the data to the XMI format so it can be imported to visual paradigm and other tools.

Rose CRC

Rose CRC<ref name="rosecrc">Wilkinson, N. Using CRC Cards, "An Informal Approach to Object-Oriented Development," SIGS, New York, 1995.</ref> is a tool that supports CRC card processes at various levels. This tool is used to record responsibilities of classes, their collaborators, and also maintain superclass/subclass relationships. The tool provides an option of flipping the card to mention the attributes, description and any comments for that class. The tool is fairly simple to use and provides an option of selecting from existing classes and their responsibilities, collaborators and superclass/subclass relationships by a drop down menu. A detailed view of responsibilities can be provided in a separate window.


Rose CRC Tool


The tool provides an option of viewing the cards in various ways, like as a single card, showing all cards in a window, in a browser window, cards grouped by sub systems, etc. These views are highly connected and thus easily navigable. It can also help generate hierarchy graphs for any class. The tool is fairly simple to use and intuitive.

Use Case Driven Design

Use Case Driven Design<ref name="ucdd">Use Case Driven Design</ref> tool is developed by itbrain. The objective of this tool is to save time and helps design CRC cards and use cases based on the design. UCDD is a very practical aproach to object modeling. It helps you avoid getting lost on modeling everything. The use cases serve as a guide on what should be modeled. Several types of UML diagrams are needed but the bulk of the work is in the sequence diagrams and that's where you save time with this tool.

The idea is that correlating the use cases with the UML sequence diagrams is possible to determine the objects involved, the methods that should be implemented and the way the objects collaborate with others.<ref name="ucdd" /> This tool allows you to enter the usecases with interleaved sequence diagramas using your favorite Editor. Using a maven plugin this xml files are converted in to the CRC cards so you have your initial class design.

Conclusion

CRC cards are used to give a useful and convincing experience with objects and the mechanisms of objects but do not yet see their value. Using CRC cards, one can speculate the designs, ensure that they are concrete and establish an explicit relationship between objects. This makes it easier to understand, evaluate, and modify a design. One of the major problem for using this is the integration of the cards with larger design methodologies and with particular language environments. The need to retain the value of physical interaction points to the need for a new kind of user interface and programming environment as far beyond what we have today as our current systems are beyond the tool-oriented environments of the past.<ref name="paper" />

See Also

References

<references/>

External Links