Skip to content

hexaglue/case-study-banking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Acme Banking - Case Study

Enterprise banking application used as a case study for progressive migration to Hexagonal Architecture with HexaGlue.

Structure

case-study-banking/
├── legacy/       # Original multi-module application (technical layers)
└── hexagonal/    # Migrated application (hexagonal architecture + HexaGlue)

Prerequisites

  • JDK 21 (for example via Homebrew: brew install openjdk@21)
  • Maven 3.9+ installed and available on PATH

If Java 21 is not your default JDK, export JAVA_HOME before each command (or add the export to your .bashrc / .zshrc):

# On macOS with Homebrew
export JAVA_HOME="/opt/homebrew/opt/openjdk@21/libexec/openjdk.jdk/Contents/Home"

Quick Start

Legacy Application

cd legacy
mvn clean install
mvn spring-boot:run -pl banking-app

Then open http://localhost:8080/h2-console (JDBC URL: jdbc:h2:mem:bankingdb).

Hexagonal Application

cd hexagonal
mvn clean install
java -jar banking-app/target/banking-app-0.1.0-SNAPSHOT.jar

Then open:

Note: mvn spring-boot:run does not work for the hexagonal application because it re-triggers HexaGlue's code generation in single-module mode, which breaks classpath resolution. Use the fat JAR instead. The install phase includes all prior phases (compile, test, verify), so HexaGlue generation and audit run automatically.

Migration Summary

Aspect Legacy Hexagonal
Architecture Technical layers Hexagonal (ports & adapters)
Domain model Anemic (JPA entities) Rich domain model
Value objects Primitives Typed IDs, Money, Email, Iban
Infrastructure Hand-written Generated by HexaGlue
API documentation None Swagger / OpenAPI (generated)
Modules 5 (by technical layer) 5 (by architectural role)

See MIGRATION.md for a detailed migration guide.

About

Banking Spring Boot application migrated to Hexagonal Architecture with HexaGlue. Multi-module, Java 21.

Resources

Stars

Watchers

Forks

Contributors