Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRC (Classes, Responsibilities, Collaborators) #5677

Open
mrmanc opened this issue Jul 29, 2024 · 0 comments
Open

CRC (Classes, Responsibilities, Collaborators) #5677

mrmanc opened this issue Jul 29, 2024 · 0 comments
Labels
Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request Type: New Diagram

Comments

@mrmanc
Copy link
Contributor

mrmanc commented Jul 29, 2024

Proposal

Mermaid.js should support CRC cards, as there is no online tool that does so as a first-class citizen that I can find. The same information can be codified as a design represented by a class diagram, but this exercise is a stage before that, with no conversation about inheritance etc.

Use Cases

A CRC exercise is a great step between gathering requirements, and nailing down an OO design using something like a class diagram. It can be done as a stand-alone theoretical design exercise to have good conversations about where responsibility lives, and driving towards a more message orientated design.

Screenshots

See these articles:

I like to include space for messages in, and messages out, as per this screenshot:
image

An exercise would generate many of these cards, which could be arranged near their collaborators, with arrows to indicate the relationship between them.

Syntax

crcDiagram
  TrafficLight:
    responsibilities:
      - display current signal
    messagesIn:
      - change signal
    messagesOut:
  Sensor:
    responsibilities:
      - detect vehicle passing
    messagesIn:
    messagesOut:
      - detected vehicle
  Controller:
    responsibilities:
      - coordinate signals
      - balance traffic flow using schedule
      - ensure it is safe to change the traffic flow
    messagesIn:
      - detected vehicle
    messsagesOut:
      - change signal

Implementation

This is a proposal which I'd love to see built into mermaid by the wonderful community.

@mrmanc mrmanc added Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request Type: New Diagram labels Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request Type: New Diagram
Projects
None yet
Development

No branches or pull requests

1 participant