Low-level design
OOP foundations
The four pillars + relationships. 8 lessons where the diagrams draw themselves, one class and one message at a time, with the theory and the code beside them.
- 8 lessons
- Animated diagrams
Sign in with Google or GitHub and you land straight on this page. DSA comes with the all labs plan and every ChaiCode batch.
OOP foundations
In this module
- A class is a blueprint; an object is a concrete instance created from it, with its own state.
- Bundle data with the methods that guard it, hide the internals, and expose only a safe public interface, so invariants can’t be broken.
- Expose WHAT something does through a simple interface, and hide HOW it does it. Abstraction fights complexity; encapsulation enforces it.
- A subclass IS-A superclass, it inherits the parent’s fields and methods for free, and may add to or override them.
- One call, many forms: the SAME method name resolves to different behaviour depending on the actual object, decided at runtime.
- Inheritance locks behaviour in at compile time and explodes combinatorially. Composition, “has-a”, keeps it swappable. Prefer it.
- The arrows ARE the design. Dependency, association, aggregation, composition and inheritance say exactly how tightly two classes are bound, and who owns whose lifecycle.
- An abstract class is a half-built base you EXTEND (one parent, shared code + state); an interface is a pure contract you IMPLEMENT (many of them, no state). Knowing which to reach for is a classic interview question.
More low-level design
Start OOP foundations
Sign in and the first lesson opens with its diagram ready to play.
DSA comes with the all labs plan and every ChaiCode batch.