spring-projects / spring-projects/spring-modulith
Feature request: Documenting CQRS stereotypes in module canvases
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.2k
- Forks
- 222
- PR merge metrics
- No merged PRs in 30d
Description
Our modulithic application is designed with CQRS. We have defined commands and query models and are using them also for module communication alongside domain events. We have annotated them with @Command and @QueryModel annotations from org.jmolecules:jmolecules-cqrs-architecture.
The Documenter with JMoleculesGroupings already recognizes jmolecule's annotations and groups the components by this definitions which is very nice so far. But the Documenter applies these groupings only on Spring Beans. Similar to domain events, our commands / query models are just simple data classes and therefore are not recognized. So if I annotate my command classes with @Component they are documented in a "Commands" group as expected, but it does not make much sense to do so.
For @ValueObjects there is already a mechanism that detects them from the classes of the application's base package. Would it be possible to extend this detection for @Command and @QueryModel? Or (perhaps because it would be a rather specific behavior just for CQRS) provide an option to define custom groupings on class level as well? We have a few custom stereotypes like @Query that would be nice if they could be documented too.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the Documenter and JMoleculesGroupings behavior described in the issue, including the existing @ValueObject detection and handling of domain events. Trace how class-level annotations are discovered and grouped; done means commands and query models are documented without @Component, or a clearly defined custom class-level grouping option is supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- documentation, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100