Giter Club home page Giter Club logo

candy-doc-maven-plugin's Introduction

CandyDoc

Candy Doc Maven plugin

Maven central release License Discord members

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

Table of Contents

Installation

With Maven

To run this plugin, import the following:

<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>candy-doc</goal>
        </goals>
    </execution>
</executions>
<configuration>
    <packagesToScan>
        <packageToScan>com.foo.bar</packageToScan>
    </packagesToScan>
    <outputFormat>html</outputFormat>
</configuration>
</plugin>

Then, specify the configuration parameters:

packagesToScan: The chosen packages to scan to generate a documentation for.

Example:

<packagesToScan>
    <packageToScan>com.foo.bar.baz</packageToScan>
    <packageToScan>com.foo.qux</packageToScan>
</packagesToScan>

outputFormat: The output format in which the documentation is generated. Output format can be either html, yml or json.

Once your project is correctly annotated with the DDD Annotations, use mvn to run the plugin ( replace ${candy-doc.version} with the current version you are using):

mvn io.candy-doc:candy-doc:${candy-doc.version}:candy-doc

The documentation will be generated in the target/candy-doc directory.

DDD Annotations

Domain-Driven-Design concepts are identified with annotations.

Aggregate

@Aggregate(name = "", description = "")

Cluster of domain objects that can be treated as a single unit. It has an identity and a lifetime.

An aggregate contains the domain logic and is aware of framework issues.

It is accessed by commands, returns events and deals with value objects.

Value objects in an aggregate are usually seen as Domain entities. This is the only domain model that can be mutable.

Bounded Context

@BoundedContext(name = "", description = "")

Set of elements (classes, services, etc) containing only what is needed in a specific context.

Only package-info.java files can be annotated with @BoundedContext. Every other concepts must be inside a bounded context.

Core Concept

@CoreConcept(name = "", description = "")

Concept with the highest level of importance inside a bounded context. It is used in the domain layer, on aggregates and value objects.

A Core Concept can interact with other concepts.

Domain Command

@DomainCommand(description = "")

A command is the entry point to perform a business logic from an aggregate.

It should use primitives only (and could use value objects) and is performed on an aggregate.

Domain Event

@DomainEvent(description = "")

Captures the memory of something interesting which affects the domain. It usually starts with a verb in the past tense.

An event should always stay dumb and only carry static information.

Moreover, domain events cannot use strong domain concepts as domain logic should never be used outside the domain.

Shared Kernel

@SharedKernel(name = "", description = "")

Set of elements (classes, services, etc) containing only what is needed in a specific context. A shared kernel is the intersection of two bounded contexts (same DDD concepts used in each one). It is often used to describe the relationship between two (or more) teams that share a small but common model. It can only contains value objects and core concepts.

Only package-info.java files can be annotated with @SharedKernel. They work like bounded context do.

Value Object

@ValueObject(description = "")

An object that has no identity, no lifetime and who is compared based on his values.

A Core Concept can interact with one or more value objects. A Value Object only has primitive fields, is immutable and should be valid when instantiated.

HTML Documentation 🌐

If you have chosen html as output format, you can open the generated index.html file from your file explorer to have access to the documentation.

Navigate between the concepts of your project thanks to the left-side menu

index.png

Access the content of each concept

bounded_context.png

See the interactions between concepts

core_concept.png

ROADMAP πŸ—ΊοΈ

To know on what the team are actually working on, you can see the different milestones here

[FOR DEV] Development workflow

Release policy

The development team works on a branch named main.

Whenever a feature needs to be implemented, a new branch (feat/<new_branch>) must be pulled from main and rebased to this later once the feature is ready.

graph TD
    .. --main--> 1
    1 --> 2
    2 --> 3
    3 --> 4
    1 --feat/my-feature--> 2bis
    2bis --> 3bis
    3bis --> 4bis
Loading

Then, we will approve your changes and we will push these changes to main.

Depending on which improvements you will bring to the plugin, you will have to choose the right gitmoji in your PR name in order to publish a new version.

graph TD
    .. --feat/my-feature--> 1
    1 --> 2
    2 --> 3
    3 --> 4
    4 --> 2bis
    2bis --> 3bis
    3bis --> 4bis
Loading

Explanations:

Before each new feature, run:

git checkout main
git pull

Create a new branch feat/<branch name> for the feature

git checkout -b feat/<branch name>

Once the feature is implemented, create a pull request to get the approval of a reviewer. If it's approved, your feature will be squash and merge feat/<branch name> to main.

See contributing rules here.

/!\ Don't forget to pull the updated pom.xml once the release job is done. /!\

git pull

Technologies

Project created with:

Technology Version
Java 11
Maven 3.6.3
Reflections8 0.11.5
Lombok 1.8.12
Jackson 2.8.6
Apache Freemarker 2.3.31
Apache Commons-IO 2.8.0
Maven Release 3.0.0-M4

References

Join us πŸ™‹

If you want to get in touch with our community there is a Discord server, join us !

Discord

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Maxime Deroullers

πŸ‘€

Charles Tacquet

πŸ“– πŸ› πŸ’» πŸ”£ 🎨 πŸ’‘ πŸ€” πŸ’¬ πŸ‘€ ⚠️

Edouard CATTEZ

πŸ‘€

Tiflo

πŸš‡ πŸ“– πŸ‘€ βœ… πŸ› πŸ€” 🚧 πŸ’¬ πŸ“¦

Maji

πŸ“– πŸ€” πŸ‘€

Pierre

πŸ“– πŸš‡ πŸ‘€ πŸ“¦

François Delbrayelle

πŸ“–

AVernholles

πŸ“– πŸ’» πŸ› ⚠️ πŸ€” πŸ‘€ πŸ’‘ 🎨 πŸ–‹

aginesy

πŸ“– πŸ’» πŸ› ⚠️ πŸ€” πŸ‘€ πŸ’‘ 🎨 πŸ–‹

This project follows the all-contributors specification. Contributions of any kind welcome!

candy-doc-maven-plugin's People

Contributors

tifloz avatar michiels96 avatar allcontributors[bot] avatar aginesy avatar ctacquet avatar avernholles avatar m4gie avatar ecattez avatar semantic-release-bot avatar fdelbrayelle avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.