Candy Doc is a documentation generator plugin for projects built with the Domain-Driven-Design approach.
"Domain-Driven Design is an approach to software development that centers the development on programming a domain model that has a rich understanding of the processes and rules of a domain." - Martin Fowler See more
To run this plugin, import the following in your project pom.xml :
<dependency>
<groupId>io.candy-doc</groupId>
<artifactId>candy-doc</artifactId>
<version>${candy-doc.version}</version>
</dependency>
<plugin>
<groupId>io.candy-doc</groupId>
<artifactId>candy-doc</artifactId>
<version>${candy-doc.version}</version>
<executions>
<execution>
<goals>
<goal>ubiquitous-language</goal>
</goals>
</execution>
</executions>
<configuration>
<packagesToScan>
<packageToScan>com.foo.bar</packageToScan>
</packagesToScan>
<outputFormat>json</outputFormat>
</configuration>
</plugin>
Then, specify the configuration parameters:
- outputFormat: The output format in which the documentation is generated.
- Output format can be either
json
oryml
.
- Output format can be either
- packagesToScan: The chosen packages to scan to generate a documentation for, as shown below :
<packagesToScan>
<packageToScan>com.foo.bar.baz</packageToScan>
<packageToScan>com.foo.qux</packageToScan>
</packagesToScan>
To use the plugin, you need to annotate your project with the DDD annotations described below :
Domain-Driven-Design concepts are identified with annotations.
Only package-info.java
files can be annotated with @BoundedContext
or @SharedKernel
. Every
other concepts must belong to a strategic pattern.
@BoundedContext(name = "", description = "")
@SharedKernel(name = "", description = "")
Nested bounded contexts or nested shared kernels are forbidden and prevented by the plugin when processing classes.
@Aggregate(name = "", description = "")
@DomainCommand(description = "")
@DomainEvent(description = "")
@ValueObject(description = "")
Once your project is correctly annotated with the DDD Annotations, use Maven to run the plugin :
mvn clean install
A JSON file will be generated in the target/candy-doc
directory. The next step is the candy-board downloading. Use the following commands :
npm i @candy-doc/cli
candy-doc build /target/candy-doc/ubiquitous-language/
Those two lines will download the Candy-doc CLI and download the Candy-doc UI called Candy-board.
Now, a candy-build
repository appeared in your root directory.
You can display your documentation by opening the index.html
file in your favorite browser.
Here's some features of Candy-board. Feel free to use them at your convenience.
- Node move
- SVG export
- Focus on direct neighbors (by checking
Enable hiding neigbors
) - Node position storage
- New graph generation (by clicking
Reset graph
)
If you face any issue feel free to create an issue on the GitHub repository or to contact us on our Discord server, join us !
To know on what the team are actually working on, you can see the different milestones here
- DDD (Martin Fowler): https://martinfowler.com/tags/domain%20driven%20design.html
- DDD, en vrai pour le dΓ©veloppeur (Cyrille Martraire): https://www.youtube.com/watch?v=h3DLKrvp5V8
- Summary of a 4 days DDD Training (Thomas Ferro): https://thomasferro.medium.com/summary-of-a-four-days-ddd-training-74103a6d99a1
If you want to get in touch with our community there is a Discord server, join us !
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!