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.
-
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.
-
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.
-
Place the Usecase:
- Click on the map to place your selected Usecase. The Usecase will then appear on the map.
Usecase Types
Codebricks supports various Usecase types, each serving different purposes in your application. They are represented by the following icons:
Usecase Type | Icon | Description |
---|---|---|
Command API | CA | Represents a command that modifies the state. Example: User registration. |
Command Policy | CP | Enforces automation triggered by an event. Example: Send user registration email. |
Projection | P | Represents a read model or view that provides data based on events. Example: User profile view. |
Query API | Q | Represents 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.