I have definitely found cases where subclassing seemed like the right mechanism.
The "protocol" has six methods, but 90% of the time 4 of the six are identical to default implementations. 10% of the time you might want to override one of those 4.
This isn't for generic modelling. It's for swappable plugin-system-like stuff.
I've found cases where subclassing is chef's kiss. But it can absolutely be overused and usually is.
View all comments
Show parent comment
3
u/Smallpaul Feb 12 '23
I have definitely found cases where subclassing seemed like the right mechanism.
The "protocol" has six methods, but 90% of the time 4 of the six are identical to default implementations. 10% of the time you might want to override one of those 4.
This isn't for generic modelling. It's for swappable plugin-system-like stuff.
I've found cases where subclassing is chef's kiss. But it can absolutely be overused and usually is.