class
CoffeeMachine
control panel
public interface · all the caller sees
idle
makeEspresso()
makeLatte()
Show
internals
Hidden pipeline
private · not part of the interface
The machinery is
behind the panel
.
Flip
Show internals
to peek at the hidden steps.
The caller
presses one button →
what the caller's code looks like
// no idea how coffee is made.
const
machine =
new
CoffeeMachine
();
machine.
makeEspresso
();
// → just waits for "ready" ☕
external log · what the world sees
Reset
▸
One
button
on the surface, a whole
pipeline
behind it. The caller presses
makeEspresso()
and only ever sees
ready
— that's abstraction.