Object-Oriented Programming (OOP)
Learn OOP the right way: classes and objects, encapsulation, abstraction, inheritance, polymorphism, composition, UML, SOLID, equals/hashCode and design.
What you'll learn
- Explain classes, objects, references, constructors and static members, and why OOP organises code around objects.
- Apply encapsulation and abstraction with access modifiers, immutable classes, abstract classes and interfaces.
- Use inheritance and overriding correctly, and recognise fragile base classes and the diamond problem.
- Explain compile-time and run-time polymorphism, dynamic dispatch and programming to interfaces.
- Model relationships with association, aggregation, composition and UML, and apply the SOLID principles.
- Implement equality, resource handling and contracts correctly, and design classes from real requirements.
Syllabus
Classes and Objects
- Why Object-Oriented Programming
- Classes, Objects, State and Identity
- Constructors, this and Static Members
Encapsulation and Abstraction
Inheritance
Polymorphism
- Compile-Time Polymorphism: Overloading
- Run-Time Polymorphism and Dynamic Dispatch
- Programming to Interfaces and Duck Typing
Relationships Between Classes
- Association, Aggregation and Composition
- Composition Over Inheritance and Delegation
- UML Class Diagrams
SOLID Design Principles
- Single Responsibility and Open/Closed
- Liskov Substitution and Interface Segregation
- Dependency Inversion and Dependency Injection
Object Behaviour: Equality, Lifecycle and Errors
- Identity, Equality and Hashing
- Object Lifecycle, Copying and Resources
- Exceptions and Design by Contract