Hello again,
One of my common task in modeling is to explain any data type by breaking them down to a set of primitive types. Otherwise my model would miss some semantics. For me, that is the very purpose of primitive types.
This might be an issue. A UML PrimitiveType is
solely and precisely something which "defines a predefined DataType, without any substructure". If you don't agree with this definition, you are headed for trouble.
A class attribute may represent the value of speed, another one the value of acceleration. Both boil down to my primitive Float. Speed and acceleration values shall not be compatible, e.g. in assignment.
Therefore I introduce a data type for the speed value, say SpeedValue_t, and for acceleration value, say AccelerationValue_t.
Makes sense.
What I understood about Generalization (an inheritance in general) is that SpeedValue_t can be defined as a special kind of Float, as is AccelerationValue_t. Means SpeedValue_t is a Float and AccelerationValue_t is a Float.
They can, if you're focusing on the representation rather than the meaning. If you're focusing on meaning, a speed
is not a float, it
is a physical property which may be measured (and the measurement may be stored in a floating-point value, or in two floating-point values, or some other way).
If you're not sure about which of these you're trying to model, again, you're headed for trouble. Are you in concept land or representation land?
But: EA justifies this as not UML compliant. For my understanding of UML 2.5.1 EA should! (using Realization relation is a workaround for me for now)
But if you decide that Float is a UML PrimitiveType, and that Speed is a UML DataType, you have also decided that they are two different things in the UML language. As I mentioned earlier in the thread, I don't believe generalizations should be permitted either way between these two, but if in any direction, it has to be from DataType to PrimitiveType, because DataTypes can have attributes and PrimitiveTypes can't. EA permits it in the other direction, which doesn't make sense.
And: as Float is not e.g. a SpeedValue_t (at least in the case of AccelerationValue_t, or if SpeedValue_t has an inheritable operation) Float can not be a special kind of SpeedValue_t! But EA allows the SpeedValut_t to be specialized to Float. This feels completely wrong!
visualisation created with EA 15.1
Didn't look at that, but I think there are two ways you can resolve this easily.
1) Make all your types either «primitive» or «dataType». «dataType» if you want them to have attributes, «primitive» otherwise.
Either way, you can generalize between them the way you want.
2) Make your Float a «primitive», and your SpeedValue_t and AccelerationValue_t «dataType»s with Float attributes.
HTH,
/Uffe