
Clean Architecture Masterclass
Introduction
This training will guide you through the major architectural styles and patterns for backend systems, including Clean Architecture, Hexagonal Architecture, Layered Architecture, Vertical Slices Architecture, Domain-Driven Design, Modular Monoliths, and Microservices. By understanding every style and its trade-offs, you’ll learn how to combine them in your application while avoiding common pitfalls. Guided by real-world Java examples, you’ll learn how to:
Design clean and pragmatic architecture
- Slice and structure your application by Features.
- Group code by the axis of change.
- Organize code in functional top-level packages.
- Find package boundaries (heuristics).
- Remove cyclic dependencies between packages (6 strategies).
- Separate module/compilation units.
- Decouple modules/packages/components with Dependency Inversion.
- Reduce cognitive load with modularity and information hiding.
- Enforce architectural constraints.
- Isolate the core application logic from the infrastructure.
- Test your core logic, infrastructure, and integrations.
- Segregate data structures and DB Schemas.
- Balance between uniformity/standardization and pragmatism.
- Leverage Evolutionary Architecture and avoid big up-front designs.
- Incrementally migrate from legacy Big Ball of Mud to Modulith/Microservices.
Design clean services and domain model
- Apply SOLID Principles and Five Rules of Simple Design.
- Masterfully balance coupling and cohesion.
- Make your code speak the domain language.
- Separate the core domain from subdomains.
- Decouple domains with APIs and events.
- Design rich domain entities (OOP done right).
- Protect domain objects’ invariants (strategies).
- Decouple the domain from the infrastructure, API, and persistence.
- Create an Anti-Corruption Layer with Adapter pattern.
- Test-drive the domain with fast unit tests.
- Map the domain to the API DTOs (and stay away from auto-mappers).
- Separate logic by Layers of Abstraction.
- Design Application Services, Controllers, and Façades.
- Logically separate commands from queries with CQRS.
- Improve query performance by using a separate read model.
- Keep write and read models in sync.
By the end of this course, you’ll be able to mix and apply essential architectural styles – Clean-, Hexagonal-, Layered-, Onion-, Screaming-, and Vertical Slices- Architectures, Domain-Driven Design, Microservices, Monolith, and Modular Monoliths. You’ll develop a firm understanding of the underlying architectural principles and learn how to implement them in your Java applications incrementally, as necessary, without big rewrites.
