What problem does it solve?
This Skill guides the design and implementation of the Application Layer's UseCase interfaces (Port-In) and Service implementations. It ensures a clean separation of concerns, adheres to CQRS principles, and manages transaction boundaries properly, leading to highly maintainable and testable business logic.
Core Features & Use Cases
- UseCase Interface Definition: Creates clear, single-responsibility
UseCase interfaces (e.g., PlaceOrderUseCase, GetOrderUseCase) as inbound ports, defining the application's capabilities.
- CQRS Service Implementation: Generates distinct Command Services (for state changes) and Query Services (for data retrieval), adhering to the "execute()" single-method pattern for consistency.
- DTO Management: Defines
Command, Query, and Response DTOs as immutable records, ensuring data integrity and clear communication between layers.
- Transaction Boundary Delegation: Enforces that
@Transactional annotations are managed by Facade/Manager components, not directly within Services, for better control and testability.
- Use Case: When developing a new business capability, use this skill to define the UseCase interface, implement its service, and create the necessary DTOs. This ensures it aligns with the hexagonal architecture and CQRS, accelerating development and reducing architectural debt.
Quick Start
Create a 'Place Order' UseCase, including its interface, command DTO, response DTO, and service implementation.