AI Instructor Live Labs Included

Object-Oriented Design in Java

Learn OOP design patterns and SOLID principles in Java by building a RideShare simulation. Covers Factory, Builder, Strategy, Observer, Decorator, Adapter, and Dependency Injection through hands-on refactoring.

Intermediate
17h 25m
14 Lessons
SMU-JAVA-OOP
Java OOP Design Patterns Badge

View badge details

About This Course

Master object-oriented design principles and patterns in Java by building a RideShare simulation from the ground up. This course covers SOLID principles, Factory, Builder, Strategy, Observer, Decorator, Adapter, and Dependency Injection patterns through hands-on refactoring exercises. Students progressively transform a monolithic codebase into a clean, extensible, pattern-driven application.

Course Curriculum

14 Lessons
01
AI Lesson
AI Lesson

SOLID Principles

1h 0m

Learn all five SOLID principles with real Java examples from the FleetFlow ride-sharing domain. Covers Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion Principle with before/after code comparisons.

02
Lab Exercise
Lab Exercise

SOLID - Lab Exercises

1h 30m 3 Exercises

Hands-on exercises refactoring a monolithic RideShareApp to apply SOLID principles. Students extract domain classes (SRP), split the Vehicle interface into focused role interfaces (ISP), and wire a MapService abstraction into TripDispatcher (DIP).

03
AI Lesson
AI Lesson

Factory and Builder Patterns

1h 0m

Learn the Factory and Builder creational patterns. Factory centralizes object creation behind a single method so callers never use new directly. Builder assembles complex objects with fluent setter chains. Both patterns are applied to the RideShare vehicle and trip creation scenarios.

04
Lab Exercise
Lab Exercise

Factory & Builder - Lab Exercises

1h 30m 3 Exercises

Hands-on exercises implementing VehicleFactory with an arrow switch, building a fluent TripBuilder with validation, and adding a config-file vehicle loader. Students replace all direct new Car/Van/Motorcycle calls with factory calls.

05
AI Lesson
AI Lesson

Strategy Pattern

1h 0m

Learn the Strategy Pattern — defining a family of interchangeable algorithms encapsulated behind a common interface. Applied to RideShare pricing: StandardPricing, SurgePricing, and FlatRatePricing can be swapped at runtime without changing TripDispatcher. Also covers Strategy vs Template Method.

06
Lab Exercise
Lab Exercise

Strategy - Lab Exercises

1h 30m 3 Exercises

Hands-on exercises implementing StandardPricing, SurgePricing, and FlatRatePricing strategies, injecting a strategy into TripDispatcher via constructor, adding a null-guarded setter, and building an interactive pricing menu that swaps the active strategy at runtime.

07
AI Lesson
AI Lesson

Observer Pattern

1h 0m

Learn the Observer Pattern — one-to-many dependency where subject notifies all observers on state change. Applied to Trip completion: ReceiptService, DriverEarningsService, and AnalyticsService are observers registered on Trip. Covers thread safety with CopyOnWriteArrayList and memory leak prevention.

08
Lab Exercise
Lab Exercise

Observer - Lab Exercises

1h 30m 3 Exercises

Hands-on exercises implementing ReceiptService, DriverEarningsService, and AnalyticsService observers, making Trip observable with add/remove/notify methods, registering all observers in Main.java, and adding a StatusLogObserver to verify notification order.

09
AI Lesson
AI Lesson

Decorator and Adapter Patterns

1h 0m

Learn the Decorator Pattern (adding behavior at runtime without subclassing) and the Adapter Pattern (making incompatible interfaces work together). Decorator is applied to TripService add-ons; Adapter wraps LegacyGpsLibrary behind the MapService interface.

10
Lab Exercise
Lab Exercise

Decorator & Adapter - Lab Exercises

1h 45m 3 Exercises

Hands-on practice applying the Decorator and Adapter patterns to the RideShare simulation. Extend trip pricing with stacked decorators and integrate a legacy GPS system through an adapter.

11
AI Lesson
AI Lesson

Dependency Injection

30m

Learn how to implement Dependency Injection manually in Java by building a simple DI container, applying constructor injection throughout the RideShare app, and establishing a clean composition root using the AppContainer pattern.

12
Lab Exercise
Lab Exercise

Dependency Injection - Lab Exercises

1h 45m 3 Exercises

Hands-on practice refactoring the RideShare simulation to use constructor injection throughout and wiring the entire object graph in a single AppContainer composition root.

13
AI Lesson
AI Lesson

Capstone Briefing

20m

A comprehensive review of all six design patterns covered in the course and a detailed briefing on the RideShare capstone project requirements that students will implement in the final lesson.

14
Lab Exercise
Lab Exercise

Capstone Project

2h 5m 3 Exercises

The final capstone project for Object-Oriented Design in Java. Students implement a complete RidePool feature that integrates all six design patterns: Factory, Builder, Strategy, Observer, Decorator, and Adapter — assembled with Dependency Injection in a composition root.

This course includes:

  • 24/7 AI Instructor Support
  • Live Lab Environments
  • 7 Hands-on Lessons
  • Completion Badge
Java OOP Design Patterns Badge

Earn Your Badge

Complete all lessons to unlock the Java OOP Design Patterns achievement badge.

Skill Level Intermediate
Total Duration 17h 25m
Java OOP Design Patterns Badge
Achievement Badge

Java OOP Design Patterns

Awarded for completing the Java OOP Design Patterns course, demonstrating mastery of creational, structural, and behavioral design patterns in Java.

Course Object-Oriented Design in Java
Criteria Complete all lessons and pass assessments in the Java OOP Design Patterns course.
Valid For 730 days

Skills You'll Earn

Design Patterns SOLID Principles Creational Patterns Structural Patterns Behavioral Patterns Refactoring

Complete all lessons in this course to earn this badge