• Teilen
  • E-Mail
  • Einbetten
  • Gefällt mir
  • Speichern
  • Privater Inhalt
CRC Cards
 

CRC Cards

on

  • 4,729 Views

Identifying classes from use cases using CRC Cards

Identifying classes from use cases using CRC Cards

Statistiken

Views

Gesamtviews
4,729
Views auf SlideShare
4,729
Views einbetten
0

Actions

Gefällt mir
1
Downloads
0
Kommentare
0

0 Einbettungen 0

No embeds

Zugänglichkeit

Details hochladen

Uploaded via as Microsoft PowerPoint

Benutzerrechte

© Alle Rechte vorbehalten

Report content

Als unangemessen gemeldet Als unangemessen melden
Als unangemessen melden

Wählen Sie Ihren Grund, warum Sie diese Präsentation als unangemessen melden.

Löschen
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Ihre Nachricht erscheint hier
    Processing...
Kommentar posten
Kommentar bearbeiten
  • CRC cards were introduced by Kent Beck and Ward Cunningham in their paper "A Laboratory for Teaching Object-Oriented Thinking" released in OOPLSA '89. There original purpose was to teach programmers the object-oriented paradigm. When Kent Beck wrote the draft version of their paper he changed Collaborators to helpers. Ward Cunningham changed it back to Collaborators when he reviewed the paper. The initials of Cunningham's son are CRC.
  • Although CRC cards were created for teaching, they have proven useful for much more. They become an accepted method for analysis and design. The biggest contributing factor to their success is the fact that they provide an informal and non threatening environment that is productive to working and learning.
  • These are terms used throughout this tutorial as defined by Grady Booch.
  • This size generally allows everyone to productively participate. If there are more than six people, one solution is to have the extra people be present strictly as observers. In the initial Analysis phase there should be two or three domain experts, one object-oriented technology facilitator, and the rest of the group made up of people how are responsible for delivering the system. As the project moves more in to the design phase, some of the domain experts can be replaced with developers. There should always be at least one domain expert in the group to clarify an question that arise about the behavior of the system.
  • The exact format of the card can be customized to the preferences of the group, but the minimal required information is the name of the class, it's responsibilities and the collaborators. The back of the card can be used for a description of the class. During the design phase attributes of the class can be recorded on the back as well. One way to think of the card is the front as the public information, and the back as the encapsulated, implementation details. So you might list attributes (properties) on the back.
  • Remember, for larger projects, we won’t be looking at the entire problem. Only a portion.
  • Always start with basic functionality at first. Only move on to advanced or optional functionality later. Examples: Error checking, non-essential, and so on.
  • Resist the temptation to get too far into the details.

CRC Cards CRC Cards Presentation Transcript

  • CRC Cards: An Overview
  • CRC Cards Conceptual Overview
    • An index card that is used to represent …
      • A class
      • the responsibilities of the class and
      • the interaction between classes.
    • CRC cards are a creative approach to object oriented modeling.
    • The cards are created through scenarios based on the system requirements that model the behavior of the system.
    • The name CRC comes from Class, Responsibilities, and Collaborators which the creators found to be the essential dimensions of object oriented modeling.
  • Why use CRC cards?
    • Portable... No computers need. They can be used anywhere. Even away from the office.
    • They allow the participants to experience first hand how the system will work. No computer tool can replace the interaction that happens by physically picking up the cards and playing the role of that object.
    • They are useful for teaching people the object-oriented paradigm.
    • They can be used as a methodology themselves or as a front end to a more formal methodology such as USDP, RUP, Booch, Wirfs-Brock, or Jacobson.
  • Glossary
    • Class: The blueprint for an object.
    • Collaboration: The process whereby several objects cooperate to provide some higher-level behavior.
    • Object: Something that can do things. An object has state, behavior, and identity. The structure and behavior of similar objects are defined in their common class.
    • Responsibility: Some behavior for which an object is held accountable. A responsibility denotes the obligation of an object to provide a certain behavior.
    • Subclass: A class that inherits from one or more classes.
    • Superclass: The class from which another class inherits.
  • The Group
    • The ideal group size for a CRC card session is five or six people.
    • In groups of larger size the productive is cut by more disagreements and the amount of participation by everyone is lower.
    • Who should be in the group?
      • One object-oriented technology facilitator
      • Two or three domain (business) experts,
      • The rest should be developers
  • The Cards Collaborators Responsibilities Subclasses: Superclass: Class Name
  • How do we identify classes?
    • The first step in modeling an system in the object-oriented paradigm is to identify the class in the problem domain.
      • So this is the first step in a CRC card session.
    • Look at the use cases or requirements document.
    • Find the nouns .
      • Nouns imply classes.
    • Use this information for the basis of a brainstorming session.
    • Write one class name at the top of each card.
    • Assign each class to a member of the group.
      • He/she becomes the owner of that class for the session.
  • The Scenario
    • The team breaks the use cases into scenarios.
    • They focus on one scenario at a time.
    • The facilitator reads through the use-case scenario.
    • As an object is instantiated, the owner of that base class picks up his class’s CRC card.
      • As long as that class is ‘alive’, the owner keeps the card in the air.
    • While reading through each line in the scenario, the team identifies
      • Responsibilities
      • Other classes
      • How each class interacts with others.
    • The owner of that card writes the team’s findings on the card.
    • We keep doing this through each step and each scenario.
  • How do we identify responsibilities?
    • Some responsibilities are obvious from:
      • The name of the class
      • The use case description.
    • Others will be fleshed out as the team walks through scenarios.
      • Most of those become obvious as well.
    • Find the verbs in the use cases.
      • Verbs imply responsibilities.
    • You don't need to find them all (or any) before the scenarios.
      • The advantage of finding some in the beginning is that it help provide a starting place.
  • How do we identify Superclasses and Subclasses?
    • Superclasses and subclasses can be defined at any time they become obvious.
    • The scenarios will illuminate these as well.
    • It is up to the group to decided if they want to define any hierarchical relationships now or wait till the scenarios to do this.
  • How do we identify attributes?
    • Attributes of the classes aren’t really supposed to be identified during the CRC session.
      • They are an implementation detail.
      • Should go on the back of the card.
    • But if you really, really want to, go ahead.
    • Find the adjectives .
      • Adjectives imply attributes.
    • The responsibilities of the class will help make these clear.
    • Attributes are general not defined at all until the design phase, but they can be defined at any time the group thinks it is appropriate.
  • How do we identify collaborations?
    • Anytime a use case involves two or more classes, a collaboration exists.
    • Strong relationships exist when two or more classes are together in the same step of a scenario.
  • Conclusion
    • A fun, effective way to work through OO Analysis.
    • Makes the art of identifying classes, responsibilities (methods), and collaborations simple.