Skip to content

This archetype is used to create a maven project structure inpired by Uncle Bob's Clean architecture concept.

Notifications You must be signed in to change notification settings

anynamus/modular-service-archetype

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Modular Service Archetype

This archetype is used to create a maven project structure inpired by Uncle Bob's Clean architecture concept. The following diagram exposes an overview of this model:

Overview


Generated project structure

When using this archetype with these parameters:

mvn archetype:generate -DarchetypeGroupId=ca.anynamus.archetype \
	-DarchetypeArtifactId=modular-service-archetype \
	-DgroupId=ca.anynamus.user \
	-DartifactId=user

the following directory and project structure is genarated. For simplycity, the generated packages have been removed:

+---api
|   \---src
|       +---main
|       |   +---java
|       |   \---resources
|       \---test
|           +---java
|           \---resources
+---core
|   \---src
|       +---main
|       |   +---java
|       |   \---resources
|       \---test
|           +---java
|           \---resources
\---gateway
|   \---gateway-api
|       \---src
|           +---main
|           |   +---java
|           |   \---resources
|           \---test
|               \---resources
+---driver
|

This hierarchy is expressed like this from a maven artifact point of view :

+---user-api
+---user-core
\---user-gateway
|   \---user-gateway-api
+---user-driver

Overview

API

This module contains the interfaces for entities and use cases of the project.

Core

This module implements the entities and use cases defined into the API module.

Gateway API

This module contains the interfaces exposing the functionalities to access the entities by the mean of repositories.

Gateway Implementations

This project may contains one or more gateway-api implementations. As an example, the user gateway may have an in memory repository implementation for testing purpose and another JPA repository implementation for the production environment.

Driver

A driver module is mainly how the service functionnality will be exposed to the rest of the world.

The driver is a project of type pom because it may host more than one type of driver. As an example, the core business logic may be exposed as as a web service as well as command line batch.


References

mattia-battiston/clean-architecture-example

This project is a very good overview of the clean architecture's purpose. Note that this archetype's gateway concept is the equivalent of the dataprovider and that the driver concept is the equivalent of the entrypoints concept.

Blogs & Articles
Videos & Presentations
Books
  • Clean Architecture: A Craftsman's Guide to Software Structure and Design, by Robert C. Martin

About

This archetype is used to create a maven project structure inpired by Uncle Bob's Clean architecture concept.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published