Under the Hood
Loading visualizer…
DNSresolving host
TCPconnecting
TLShandshake
HTTPrequesting
Initializing Sorting Algorithms...
Sorting
Trees
Graphs
Preparing interactive visualizations...
Under the Hood
Loading visualizer…
is-a vs has-a, the fragile base class problem, and why a composed component swaps at runtime while deep inheritance cannot
The two ways to reuse code. Inheritance models an is-a relationship: a subclass IS A kind of its base. RobotDog is-a Dog is-a Animal, so RobotDog automatically gets move(), eat(), and bark(). Reuse comes from extending a parent. It is powerful — and it is also a tight, permanent coupling to that parent, as we'll see.
Trade-offs
Active Recall
Which relationship is composition designed to model?