Clean, Pragmatic Architecture
The purpose of this course is to help developers write elegant, clean code.
Meaning expressive, simple code that is also flexible and testable. The course is a mix of theory, discussions and hands-on exercises designed to teach developers practical techniques they can immediately apply to real-world projects.
Why this workshop?
This workshop is a pragmatic review of the most common architectural decisions of a backend system, including Layered Architecture, agnostic Domain, decoupled subdomains, data mappers, and validation. For deep understanding, most concepts are demonstrated in Java code, uncovering a series of implementation tricks that you can immediately apply to your project. The last section overviews practical strategies that you can use to gradually decouple a monolithic system into independent subdomains.
The lack of a clear structure can slow us down and put the project in danger, but over-engineering can also generate remarkable waste of time, money, and brainpower. To help you find the amount of “just-enough design”, this training adopts a pragmatic point of view and then introduces techniques to gradually evolve the design to match the growing functional complexity.
By the end of the workshop, you’ll understand:
- Dependency Inversion Principle, and why it’s essential in architectures
- How to simplify logic via Separation by Layers of Abstraction
- The principles underlying the Onion-, Hexagonal-, Ports-and-Adapters, and Clean- Architectures
- The main challenges of breaking down a codebase in vertical slices
And you’ll be able to:
- Simplify your core logic by protecting it against API models
- Progressively extract orchestration logic from existing code in Facades
- Compare and apply strategies to decouple a monolith in subdomains
What will you learn?
- Control your core data structures
- Data Transfer Objects, seen as enemies
- Isolating your Domain: why, when, and how
- Adapter Pattern
- The fallacy of auto-mappers
- Dependency Inversion Principle (at package and module level)
- Break down logic in Layers (horizontally)
- Layered Architecture and variants
- Facade Pattern and Separation by Layers of Abstraction
- Enriching Entities with behavior and constraints
- Keeping Domain Services cohesive
- Enriching the Domain Model
- Data Validation Strategies
- Feature Envy code smell
- What logic [not] to push in Entities
- Break logic in Subdomains (vertically)
- The Onion Architecture – 1 hour
- Fundamental rules
- Debate: unified Domain/Persistence model (pragmatic variation)
- Debate: selecting DTOs with ORM (pragmatic variation)
- Enforcing rule
- Breaking the Monolith: the safe parts
- The history of a successful monolith
- Replace direct cross-subdomain calls with API calls and domain events
- (ORM) Replace entity links with numeric columns
- Introduce (redundant) projections
- Breaking the Monolith: cutting the links (overview)
- Decoupling via orchestration or choreography
- Facing Eventual Consistency by cutting Foreign Keys, Distributing Transactions, and Replicating
- Review of the key take-aways
- The clash between Single Responsibility Principle (SRP) and Don’t Repeat Yourself (DRY)
- More debates / Q&A
Who is the trainer?
Victor is one of the top technical trainers in Bucharest, well-known for the passion he dedicates to every minute of his classes. His training experience is impressive: he trained 1.5K+ developers over 300 days of in-house sessions held at dozens of companies throughout Europe. Today, he is regularly called by companies of all sizes to help bringing Software Craftsmanship ideology and eXtreme Programming practices to their technical culture.
After 15 years of professional career, Victor is also a Lead Architect at IBM, where he is crafting code and coaching others every day. He is Associate Professor at Politehnica University (UPB) and founder of Bucharest Software Craftsmanship Community in which he runs monthly free webinars. Victor has become internationally renowned by his passion for Clean Code and is now frequently invited to speak at many conferences around the world. His personal commitment is to grow in developers their passion for code.
Who is it for?
This workshop is for you because…
- You are a developer with hands-on experience in software design
- You are an architect or a technical lead looking to debate key design decisions
- You are an enthusiastic learner who wants to enter the area of software architecture
A personal laptop with your favorite IDE, JDK 8+, working Maven (connected to central) and Git. You will be asked to clone a repository several days before the workshop.
- Read this (very influential) article about Clean Architecture: https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html
- Have a taste of Domain-Driven Design https://www.infoq.com/minibooks/domain-driven-design-quickly/
- Brainstorm one question from your team to debate in the final section and send it to the organizers by the evening before the training.
Java Champion & Independent Technical Trainer