Hi Ian,
Thanks for the input.
To add my 2c to the debate...
I'm sure I was taught, when I was getting starting the OO world (probably about the same time as Paolo) that specializing like this - not inheriting everything from the parent - was a Bad Thing. A bit like multiple inheritance (see Tom Love's "Seven Deadly Sins of OO" ).
A couple of points here. I've mentioned many times, that modelling isn't coding. While we can't help but use the overlapping terminology (inheritance, composition, aggregation etc.) their realisation may be somewhat different. This is what I'm trying to look at. While our modelling may be oriented around instances (both specific and placeholder - a form of classification), the instances aren't "runtime objects" as in coding, but persistent.
And even inheriting everything, but cheating by saying 'I just override some of the behaviour of my parent, by doing nothing' was fairly bad as well.
Again, I think that was because of the state of the technology at the time (and, again in my view, to coding vs modelling). If we look at modelling the real world, we see that biological (and non-biological) inheritance is more complex than the simple inheritance allowed under most coding languages.
In this case, I'd abandon the 'generalize/specialize' approach, and use composition to assemble the right set of behaviours instead.
But without understanding the context fully, it's hard to be definite.
I agree that in this case, meronymy (probably aggregation more than composition, since the same shapescript fragment can be in multiple meronyms) is more appropriate in this case, but the technology
only allows inheritance
[1]. So we have to "go with the flow".
As you'll be aware, there's been a move away from inheritance toward composition thus, supposedly, providing more flexibility and reducing dependency. But the examples (nearly) always cite the stricter coding based inheritance and composition.
That notwithstanding, there is a place for both and it would be really cool if Sparx supported both at the metamodel level.
Paolo
[1] I
assume the technology is purely Sparx specified, but there might be some standards applicable.