modelingclass-designuse-casesystem-analysiscrc-cards

How to update use-case with CRC class name?


I'm an information engineer student and I'm studying for an exam. I have to replace nouns in use case in form of bulleted list with the name of the classes extracted with CRC cards. I'm in trouble with that because I don't know how to do it right.

Does CRC cards have to include classes that control the view? Does this control must pass through a "controller" class like (in my case) "Connection"?

Does CRC cards have to include classes that control the database?

Can someone help me to understand how to do this correctly? Sorry for my English and sorry for the "strange" question

NOTE: ALL THE EXAMPLES ARE CREATED BY ME, SO I DON'T KNOW IF THEY ARE CORRECT


Solution

  • There's no direct relation

    CRC cards and use-cases are two independent techniques:

    Start to derive classes with an indirect relation

    Use-cases can be mapped to classes, using the Entity-Control-Boundary technique. Let's imagine an actor Sales admin and a use-case Manage products:

    Use the CRC cards to fine-tune the design

    This could be the start for 3 first CRC cards, which would clarify clarify what class does what (including UI and DB persistence). You'd quickly find out that these initial "analysis classes" need to be broken down further and enriched.

    For example:

    You may continue to enrich your CRC set and play with the cards, until you’re satisfied with the classes and reached a stable split of responsibilities. CRC is ideal for iterative work ;-)

    Additional comments

    The main benefit of the EBC approach is its ability to relate classes to use-cases. This is not only a theoretical benefit, but also a very practical: if you change a class, you may then easily determine potential impact for the users (and points of attention for tests). So every time you create a new CRC card, you may simply keep a trace of the related use-case(s).

    A final word on use-cases: “the system updates the page” is not a use-case: this is not a goal for an actor. It is some action the system has to perform in some larger context.

    P.S: Sorry if this might come to late for your exam