"If you use STI, you will forever bind the two+ models together in ways that can be very hard to undo - a data migration is never fun."
I don't see what's wrong with building a class hierarchy using Single Table Inheritance. Sure the two+ models will be bound together: that's exactly the point, isn't it? The proposed alternative, using modules, is meant to cover another aspect of domain modeling altogether.
Either you talk about why inheritance is "wrong" (as opposed to using modules -- and they both have their use), or you talk about why STI is a bad implementation of inheritance. Simply stating that STI is a metric of "bad" code is outrageous.
Comments
onno.solin.eu replied ago:
"If you use STI, you will forever bind the two+ models together in ways that can be very hard to undo - a data migration is never fun."
I don't see what's wrong with building a class hierarchy using Single Table Inheritance. Sure the two+ models will be bound together: that's exactly the point, isn't it? The proposed alternative, using modules, is meant to cover another aspect of domain modeling altogether.
Either you talk about why inheritance is "wrong" (as opposed to using modules -- and they both have their use), or you talk about why STI is a bad implementation of inheritance. Simply stating that STI is a metric of "bad" code is outrageous.
Onno
,
,
Voters For This Link (16)
Voters Against This Link (0)