3 ms·
OO design is ultimately API design. Unfortunately, it's often taught with toy noun examples that have obvious/actual internal fields and data structures. It'd
by ethbr1 2y ago
OO design is ultimately API design.
Unfortunately, it's often taught with toy noun examples that have obvious/actual internal fields and data structures.
It'd be better taught solely using abstract nouns, to better nudge learners into explicitly thinking about external/API design vs internal state.
Or, in other words, getters and setters are subcases where the external/API exposed is 1:1 with internal state.