Skip to main content

Usecases

Usecases are fundamental building blocks within the Codebricks Platform.
They represent individual functions or operations of your application and are the smallest unit of work that Codebricks manages.

Select Usecase

Before you can add or configure a Usecase, you need to ensure that an aggregate is selected.

  1. Select an Aggregate:

    • Click on the aggregate selection dropdown at the bottom of the left menu bar to either select an existing aggregate or choose a new one.

    For more information, refer to the Aggregate page.

    Codebricks Planner menu for aggregate and usecase selection with a highlight on the aggregate selection.

  2. Select a Usecase Type:

    • After selecting an aggregate, choose the Usecase type from the menu above the aggregate selection.
    • For example, to add a Command API Usecase, click on the CA icon.

    Command API Selection

  3. Place the Usecase:

    • Click on the map to place your selected Usecase. The Usecase will then appear on the map.

    Usecase on map

Usecase Types

Codebricks supports various Usecase types, each serving different purposes in your application. They are represented by the following icons:

Usecase TypeIconDescription
Command APICARepresents a command that modifies the state. Example: User registration.
Command PolicyCPEnforces automation triggered by an event. Example: Send user registration email.
ProjectionPRepresents a read model or view that provides data based on events. Example: User profile view.
Query APIQRepresents a query that retrieves information without modifying the state. Example: Retrieve user details.

Each Usecase type plays a specific role in the architecture, enabling you to design and implement complex asynchronous microservices efficiently.