3 ms·
> (via @ararwhatever) The most lacking skill that I tend to see is an inability to think in types, and to design software accordingly. > (via @userbinator) Yes
by CodeWriter23 7y ago
> (via @ararwhatever) The most lacking skill that I tend to see is an inability to think in types, and to design software accordingly.
> (via @userbinator) Yes, I'd call that "grouping related data (and functions, if you're using OOP) together"; no need to obfuscate the matter by saying "thinking in types".
There's some nuance between what you two are saying. IMO the "related" vector (depending on the definition) is a potential driver of what I refer to as the "Single Class Application". Back to the OP example, the Shipment and Notification are related to an Order. The simple "related" question says it's ok to implement all of those in one class instead of three.
The real questions to ask are about the specific relationship of possession. Does this attribute BELONG to this object or another? Does this object DO this action? These go a little beyond the typical OOP mantra of abstraction and encapsulation.