About This Module
Course Overview
This module builds advanced programming skills through a progressive, use-case-driven approach. Starting from object-oriented foundations, students advance through polymorphism, generics, exception handling, and Design by Contract, culminating in comprehensive coverage of creational, structural, and behavioural design patterns.
Every lecture extends the same SmartShelf library management system, providing continuity and depth — each week's concepts are applied to evolving, real-world code that students build incrementally.
What You'll Achieve
Learning Outcomes
LO1
Critically evaluate the utility of OOP principles — abstraction, encapsulation, inheritance, and reusability
LO2
Apply polymorphism, generics, and type-safe collection hierarchies to design flexible, extensible systems
LO3
Implement robust exception handling strategies and Design by Contract for secure, resilient software
LO4
Select and apply appropriate creational, structural, and behavioural design patterns to solve real-world problems
LO5
Demonstrate advanced programming through hands-on implementation, integrating multiple patterns into cohesive applications
Course Materials
Lecture Slides
Foundations
Lectures 1–2 · OOP Principles, Immutability & Object Lifecycle
SmartShelf: Book, Member, Library — core domain classes
- Core OOP principles with a critical lens
- Immutable vs mutable objects & design implications
- Value equality vs reference equality
- Defensive copies & aliasing dangers
- Hands-on: ISBN, Book, Member, Library classes
SmartShelf: Reservation system — copying Book objects safely
- Deep vs shallow cloning strategies
- Reference semantics vs value semantics
- Pitfalls of object copying & side effects
- Sharing immutable references (ISBN reuse)
- Workshop: Implement both cloning approaches
Intermediate Concepts
Lectures 3–5 · Polymorphism, Generics & Robust Design
SmartShelf: Multiple media types & search strategies
- Compile-time vs runtime polymorphism
- Method dispatch mechanisms
- Duck typing as a paradigm
- Flexible, extensible design through polymorphism
- Static typing vs duck-typed exercises
SmartShelf: Typed catalogs & member hierarchies
- Generics as type-safe polymorphism
- Working with collections: Lists, Maps, Sets
- Liskov Substitution Principle (LSP)
- Building generic data structures
- Evaluating substitutability violations
SmartShelf: Loan validation & overdue contracts
- Exception handling strategies & custom exceptions
- Checked vs unchecked exceptions
- Design by Contract: preconditions & postconditions
- Invariants & defensive programming
- Interplay between exceptions and contracts
Design Patterns & Integration
Lectures 6–9 · SOLID, GoF Patterns & Project Workshop
SmartShelf: Book factories & loan builders
- Dependency Inversion & SOLID principles
- Singleton pattern & its trade-offs
- Factory Method & Abstract Factory
- Builder pattern for complex objects
- Prototype pattern & real-world motivation
SmartShelf: External API adapters & loan decorators
- Interface adaptation: Adapter, Bridge, Facade
- Composition: Composite & Decorator
- Optimization & control: Flyweight & Proxy
- Refactoring poorly structured code
- Pattern selection decision framework
SmartShelf: Notification observers & fine strategies
- Communication: Observer, Mediator, Chain of Responsibility
- Actions: Command, Strategy, Template Method, State
- Traversal: Iterator, Visitor, Memento
- Anti-pattern: Big Ball of Mud
- Patterns as corrective design tools
SmartShelf: Full system — all patterns integrated
- Integrating multiple patterns cohesively
- Guided PRAC1 project development
- Mini code review workshop (peer evaluation)
- Presenting technical design decisions
- PRES1 preparation & lessons learned
Evaluation
Assessment
PRAC1 — Practical Project
Build a real-life application integrating OOP principles and multiple design patterns from the SmartShelf use case. Demonstrate working code with clear architectural decisions.
Coursework Component
PRES1 — Technical Presentation
Present your project's design rationale, pattern choices, and lessons learned. Peer evaluation and Q&A to demonstrate depth of understanding.
Presentation Component
Tools & Materials
Resources
Lecture Slides
Weekly presentations with theory & code examples
SmartShelf Code
Progressive codebase evolving each week
Workshop Tasks
In-class exercises mapped to lecture topics
Reading List
GoF Design Patterns, Clean Code, SOLID references
Progression