Section 19 · Stage 5: Work Like a Developer
Design Patterns & SOLID in Practice
The design patterns used in real Java code and in interviews, applied together with SOLID principles.
What you will be able to do
- Apply SOLID principles when designing new classes, not only when explaining them
- Recognise and implement the creational, structural and behavioural patterns used most in Java
- Spot these patterns inside the JDK and Spring
- Choose a pattern for a reason and avoid forcing one where it does not fit
- Solve common low-level design interview problems with clean class designs
What you will learn
19.1SOLID Recap & Design Thinking7 lessons
A quick refresh of SOLID from OOP, applied to real design decisions in ShopLite's order flow, then how principles lead to patterns.
19.2Creational Patterns8 lessons
Control how objects are created so code does not depend on concrete classes.
- Singleton: one instance on purpose40 min
- Thread-safe singletons and why Spring beans replace them45 min
- Simple factories and Factory Method40 min
- Abstract Factory: families of related objects40 min
- Builder for objects with many fields40 min
- Prototype and copying objects (brief)30 min
- Creational patterns practice45 min
- Project: ShopLite payments and order creation60 min
19.3Structural Patterns9 lessons
Combine classes and objects into larger structures without tight coupling.
- Adapter: wrapping an incompatible API40 min
- Decorator: adding behaviour without subclassing40 min
- Decorators in Java I/O streams35 min
- Proxy: lazy loading and access control40 min
- Dynamic proxies and how Spring AOP uses them45 min
- Facade: one simple entry point40 min
- Composite: trees of objects40 min
- Structural patterns practice50 min
- Project: ShopLite checkout facade60 min
19.4Behavioural Patterns9 lessons
Organise how objects talk to each other and share work.
- Strategy: swapping algorithms40 min
- Strategy with lambdas and functional interfaces40 min
- Observer: events and listeners45 min
- Template Method: fixed steps, custom details40 min
- Command: actions as objects, with undo45 min
- Chain of Responsibility: request filters45 min
- State: objects that change behaviour with status45 min
- Behavioural patterns practice50 min
- Project: ShopLite order lifecycle60 min
19.5Patterns in the JDK & Spring8 lessons
See where the patterns you learned already appear in tools you use. Spring parts are reading with short snippets, not runnable projects.
- Iterator and Comparator as patterns40 min
- Builders in HttpClient, Stream.Builder and more40 min
- Spring beans, factories and dependency injection as patterns40 min
- Template classes: JdbcTemplate and RestClient40 min
- Proxies behind @Transactional45 min
- Filter chains in Spring Security45 min
- Patterns in the JDK and Spring practice50 min
- Project: a mini dependency-injection container60 min
19.6Choosing & Refactoring to Patterns8 lessons
Use patterns to fix real design problems instead of adding them everywhere.
- Refactoring long if-else and switch to Strategy45 min
- Removing duplication with Template Method45 min
- When a pattern makes code worse35 min
- Strategy vs State35 min
- Adapter vs Decorator vs Proxy40 min
- Design patterns interview questions45 min
- Refactoring to patterns practice55 min
- Project: refactoring a legacy ShopLite checkout60 min
19.7Low-Level Design Interview Problems8 lessons
Practise the class-design questions asked in interviews, from requirements to single-file Java code.
- A method for LLD rounds40 min
- LLD: parking lot system45 min
- LLD: movie ticket booking45 min
- LLD: elevator system45 min
- LLD: splitting expenses between friends45 min
- LLD: vending machine with the State pattern45 min
- LLD practice: mock rounds60 min
- Project: food delivery LLD for ShopLite-style ordering60 min
19.8Design Patterns Practice & Review6 lessons
Apply patterns to ShopLite and review designs as you would in a code review.
