Skip to content

Getting started

Define Principal Module or Parent Module

Using Lg5 Spring Framework 1.0.0-alpha, JDK 21
More details

Dependencies diagram

Parent Module

pom.xml
<project>
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.lg5.spring</groupId>
        <artifactId>lg5-spring-parent</artifactId>
        <version>1.0.0-alpha.[check lts version]</version>
        <relativePath/>
    </parent>

    <groupId>com.blanksystem</groupId>
    <artifactId>blank-service</artifactId>
    <version>1.0.0-alpha</version>
    <packaging>pom</packaging>
    <modules>
        ...
    </modules>

    <dependencyManagement>
        <dependencies>
            ...
        </dependencies>
    </dependencyManagement>
</project>
Note: Please check the latest version

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-acceptance-test</artifactId>
</dependency> 

Domain Module

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-integration-test</artifactId>
        <scope>test</scope>
    </dependency>
</dependencies>

Project structure

└── blank-service
   ├── blank-acceptance-test
   │  └── pom.xml
   ├── blank-api
   │  └── pom.xml
   ├── blank-container
   │  └── pom.xml
   ├── blank-data-access
   │  └── pom.xml
   ├── blank-domain
   │  └── pom.xml
   ├── blank-external
   │  └── pom.xml
   ├── blank-message
   │  └── pom.xml
   └── pom.xml