JavaBank
A terminal bank in Java 21 with zero external dependencies: accounts, deposits, withdrawals, transfers and transaction history.
- Java
The case study
- Problem
- Handling money with no rounding errors and rules that cannot be bypassed, demonstrating clean architecture with no frameworks, database or libraries.
- Solution
- Only Java 21 and its standard library, with dependencies in a single direction; money always in BigDecimal (a Money value object) and a balance that only changes through a method which logs the transaction in the same step.
- Outcome
- Runnable via a run.sh that compiles with javac, no install needed; code written to read like production. Especially relevant for fintech.
Process
Development process
The reasoning behind the technical decisions: why each technology was chosen, what challenges came up and how they were solved.
- 01
Zero dependencies, on purpose
I built the bank with only Java 21 and its standard library —no frameworks, no database. The constraint is deliberate: it forces the clean architecture to stand on its own, with dependencies pointing in a single direction, and demonstrates the fundamentals without a library doing the hard part.
- 02
Money, modeled correctly
Money is never represented with float: always BigDecimal, wrapped in a Money value object that centralizes rounding. It is the most important decision in the project, because a cent-level error in a bank is not a detail.
- 03
Invariants you cannot bypass
The balance only changes through a method that logs the transaction in the same step: it is impossible to move money without leaving a trace. Modeling the rule inside the object —rather than in the code that uses it— is what makes this exercise especially relevant for fintech.
Repositories
Commits
- Cambios en el Readme
ceb5e4cEduardo3 weeks ago
- Initial commit
307508cEduardo3 weeks ago