TOPIC
Objects fuse state and behaviour — the four pillars, SOLID, patterns and UML.
WHY DID WE NEED OOP?
THE WALLData structures organise DATA — but as programs grow, the CODE around them sprawls: functions and the structs they mutate drift apart, and any line can corrupt any variable. Changing one struct breaks fifty scattered functions.
THE IDEAFuse state and behaviour into OBJECTS. Each object guards its own data (encapsulation) and exposes verbs; hierarchies share and specialise behaviour (inheritance, polymorphism). You model the problem as collaborating objects, not a pile of functions.
A vending machine you operate by its buttons, never its wires: the four pillars, SOLID and patterns are how large systems stay changeable.
Classes, objects, constructors and access — the vocabulary of OOP.
Encapsulation, inheritance, polymorphism, abstraction — the load-bearing ideas.
Interfaces, class-area members, and choosing HAS-A over IS-A.
Draw the design: the six class relationships, class diagrams and use cases.
Battle-tested solutions — Singleton, Factory, Observer, Strategy, Decorator.
Five guidelines that keep class designs flexible and changeable.