I've been playing around with generalization, particularly multiple generalization. Although EA doesn't directly support GeneralizationSets, I emulate them by using the Constraints tab and placing a GeneralizationSet name as the constraint and the defining the type of Constraint as Gen.Set.
I'm working at very high levels of abstraction, what Jim Shaw and I have coined the DIM (no jokes please :-)) - the Domain Independent Model. The model that is valid regardless of the specific domain of discourse. In there, we find things like Collections, Graphs, Containers, Components etc.
Taking Collections for example, I currently have three GeneralizationSets: Mutability (is the collection fixed or not), Associativity (is the collection associative or not), Orderedness (is the collection ordered or not). So far, I think, using combinations of these GeneralizationSets (plus further specializations, I can generate (in the conceptual sense) any collection I need. Now, different Features apply to different combinations of GeneralizationSets.
An example is: if I have an AssociativeCollection Class I hold there, the Features common to all Collections that have that property, regardless of which other GeneralizationSets apply. Similarly, I have Class called MutableCollection and Class OrderedCollection so on.
Thus any domain level Collection, just has to pick which specialization it inherits from from each GeneralizationSet.
However, at the DIM level I can also create joint specializations. I have a Class called MutableAssociativeCollection. Here I hold those Features that apply ONLY to AssociativeCollections that are also Mutable - or the MutableCollections that are also Associative.
Obviously, one can create a combinatorial explosion as more and more specializations are created.
So I need a mechanism to control this complexity.
Accordingly, if I inherit from AssociativeCollection and I'm Mutable, I also need to inherit from MutableAssociativeCollection or if I inherit from MutableCollection and I'm also Associative, I need to also inherit from MutableAssociativeCollection.
One proposal I have is to create a «generalization» Dependency which has a constraint on it that it only applies under certain circumstances. For example, in the first case immediately above, I have a «generalization» Dependency from AssociativeCollection to MutableAssociativeCollection with the constraint IsMutable == true. Similarly in the second case immediately above, I have a «generalization» Dependency from MutableCollection to MutableAssociativeCollection with the constraint IsAssociative == true.
This means that when I inherit way down the tree, I can "shimmy up" the tree and look for any such dependencies and ensure that I also inherit from the supplier of the dependency (but only if the constraint is supported).
NOTE: the constraints in this case are effectively design time constraints.
Thoughts (or better still a better solution to the problem).
TIA,
Paolo