4 ms·
In my experience, there's a process where adding accuracy (and thus usually complexity) to a domain model, implies removing existing inheritance assumptions. F
by wlievens 15y ago
In my experience, there's a process where adding accuracy (and thus usually complexity) to a domain model, implies removing existing inheritance assumptions.
For instance, in the trivial case an Employee is a Person, but when you go further you discover that there are all sorts of relations that need more detailed fleshing out. Is changing jobs just a call to Employee.setEmployer? That certainly feels akward. And as that process continues, you get a more complex domain model with comparatively less fixed inheritance relations.
The extends keyword sortof becomes an extend object, first-class among your domain and susceptible to dynamic behaviour.
But can you teach kids that in a first OO class?
EDIT: care to explain the downvote? I'm quite passionate about this subject so would love to debate it.