'CRC (Class responsibility collaborator) and UML
CRC helps to convert use cases into a set of classes and find their responsibilities and collaborators. Can we say CRC as an informal approach to UML modeling and it basically analyzes the system rather than focusing on design like UML does? I couldn't be sure after looking at different resources.
Solution 1:[1]
"Can we say CRC as an informal approach to UML modeling?"
- NO. Martin Fowler has described CRC cards as a viable alternative to UML sequence diagram to design the dynamics of object interaction and collaboration. It is not less abstract than UML use cases for example. It is simply different.
UML tries to divide structural and behavioral modelling from each other. CRC, on the contrary, considers class structure and its behaviour together. But of course, you can model using UML use cases/components diagrams, go to CRC and go on to UML class and sequence diagrams. Such translations will surely filter much of your misunderstandings and errors.
"it basically analyzes the system rather than focusing on design like UML does?"
- Sorry, also no. The main target of both tools is not the analysis (in sense "we are analyzing the system"). They are both done for modelling (also often named IT analysis). They help us to think, to imagine the system, to plan it, to check our thoughts about it.
Also, you can't compare CRC and UML because they belong to different levels. It is the same as compare an elephant from one side and a beaver's leg from the other. CRC is a method that is much more simple than any one of the UML diagrams. And far less formal than any of them, too.
UML has very strong tool on the Class diagram level and a good one on the Components diagram level, with no tools to move from the second to the first. And CRC can be very useful for closing that gap. And for supporting of sequence diagrams, too.
So, if OMG (keepers of UML) would be more eager for looking for new tools, they could include CRC as one more UML method in future. But we can use it not waiting for the formal recognition.
Solution 2:[2]
About CRC & UML, quoted from object-oriented design course from University of Alberta:
The design process consists of both the conceptual design and the technical design. Conceptual design, including prototyping and simulating higher-level designs, can be visualized through CRC cards. CRC cards make it easy to communicate with client, and they allow you to create designs without the distraction of code. However, to guide technical design, a more sophisticated technique that can communicate your needs clearly to developers is needed. One technique used for technical design is that of UML class diagram, also known as simply a class diagram. These class diagrams provide more detail than CRC cards and allow for easier conversion to classes for coding and implementation.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | |
| Solution 2 | Newsonic |
