Skip to content

Getting started

How do you implement a domain service?

Starter Describe step per step to implement a blank domain service.

⏳ Analyse the context and begin by Acceptance Test and Domain Core...

Acceptance Test Module

pom.xml
1
2
3
4
<dependency>
    <groupId>com.lg5.spring</groupId>
    <artifactId>lg5-spring-atdd</artifactId>
</dependency> 

Domain Core Module

pom.xml
1
2
3
4
<dependency>
    <groupId>lg5.common</groupId>
    <artifactId>lg5-common-domain</artifactId>
</dependency> 

Application Service Domain Module

pom.xml
<dependencies>
    <dependency>
        <groupId>lg5.common</groupId>
        <artifactId>lg5-common-application-service</artifactId>
    </dependency>
    <!-- if you need SAGA Pattern/Outbox Pattern, else remove dependencies -->
    <dependency>
        <groupId>com.lg5.spring.outbox</groupId>
        <artifactId>lg5-spring-outbox</artifactId>
    </dependency>
    <dependency>
        <groupId>com.lg5.jvm</groupId>
        <artifactId>lg5-jvm-saga</artifactId>
    </dependency>
    ...
</dependencies>

Data Access Module

pom.xml
<dependencies>
    <dependency>
        <groupId>com.lg5.spring</groupId>
        <artifactId>lg5-spring-data-jpa</artifactId>
    </dependency>
    <!-- if you need SAGA Pattern/Outbox Pattern, else remove dependencies -->
    <dependency>
        <groupId>com.lg5.spring.outbox</groupId>
        <artifactId>lg5-spring-outbox</artifactId>
    </dependency>
    ...
</dependencies>

Message Module

pom.xml
    <dependencies>
        <!-- if you need to produce events-->
        <dependency>
            <groupId>com.lg5.spring.kafka</groupId>
            <artifactId>lg5-spring-kafka-producer</artifactId>
        </dependency>
        <!-- if you need to consume events-->
        <dependency>
            <groupId>com.lg5.spring.kafka</groupId>
            <artifactId>lg5-spring-kafka-consumer</artifactId>
        </dependency>
        ...
    </dependencies>
pom.xml
1
2
3
4
5
6
7
    <dependencies>
        <dependency>
            <groupId>com.lg5.spring.kafka</groupId>
            <artifactId>lg5-spring-kafka-model</artifactId>
        </dependency>
        ...
    </dependencies>

External Module

pom.xml
1
2
3
4
5
6
7
<dependencies>
    <dependency>
        <groupId>com.lg5.spring</groupId>
        <artifactId>lg5-spring-client</artifactId>
    </dependency>
    ...
</dependencies>

API Module

pom.xml
1
2
3
4
5
6
7
<dependencies>
    <dependency>
        <groupId>com.lg5.spring</groupId>
        <artifactId>lg5-spring-api-rest</artifactId>
    </dependency>
    ...
</dependencies>

Container Module

pom.xml
<dependencies>
    <dependency>
        <groupId>com.lg5.spring</groupId>
        <artifactId>lg5-spring-starter</artifactId>
    </dependency>
    <dependency>
        <groupId>com.lg5.spring</groupId>
        <artifactId>lg5-spring-logger</artifactId>
    </dependency>
    <!-- tests -->
    <dependency>
        <groupId>com.lg5.spring</groupId>
        <artifactId>lg5-spring-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>com.lg5.spring</groupId>
        <artifactId>lg5-spring-testcontainers</artifactId>
        <scope>test</scope>
    </dependency>
</dependencies>