Enterprise banking application used as a case study for progressive migration to Hexagonal Architecture with HexaGlue.
case-study-banking/
├── legacy/ # Original multi-module application (technical layers)
└── hexagonal/ # Migrated application (hexagonal architecture + HexaGlue)
- 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"cd legacy
mvn clean install
mvn spring-boot:run -pl banking-appThen open http://localhost:8080/h2-console
(JDBC URL: jdbc:h2:mem:bankingdb).
cd hexagonal
mvn clean install
java -jar banking-app/target/banking-app-0.1.0-SNAPSHOT.jarThen open:
- http://localhost:8080/swagger-ui.html for the API documentation
- http://localhost:8080/h2-console for the database console (JDBC URL:
jdbc:h2:mem:bankingdb)
Note:
mvn spring-boot:rundoes 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. Theinstallphase includes all prior phases (compile,test,verify), so HexaGlue generation and audit run automatically.
| 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.