Issue 1446: CorbaUnion should redefine the has_feature relationship (boca-rtf) Source: (, ) Nature: Revision Severity: Summary: Summary: Section 2.2.4 (BOCA Meta-Model in CDL) identifiable CorbaUnion: CorbaStructuredType{ //attribute CorbaType discriminator_type; relationship discriminator_type Uses CorbaType; }; ... identifiable CorbaUnionMember:StructuralFeature{ attribute any label; }; The corresponding UML diagram (section 5.3) shows an association wherein CorbaUnion is a composition of CorbaUnionMember(s). Yet, this is not reflected in the CDL. It is not reflected in the CDL because of the fact that this relationship is actually a specialization of the relationship between FeatureOwner and Feature. It is understandable that this relationship was not declared in the CDL because of the following problem: Resolution: Revised Text: CorbaStructuredType{ Actions taken: June 3, 1998: received issue Discussion: End of Annotations:===== *ISSUE 18* Section 2.2.4 (BOCA Meta-Model in CDL) identifiable CorbaUnion: CorbaStructuredType{ //attribute CorbaType discriminator_type; relationship discriminator_type Uses CorbaType; }; ... identifiable CorbaUnionMember:StructuralFeature{ attribute any label; }; The corresponding UML diagram (section 5.3) shows an association wherein CorbaUnion is a composition of CorbaUnionMember(s). Yet, this is not reflected in the CDL. It is not reflected in the CDL because of the fact that this relationship is actually a specialization of the relationship between FeatureOwner and Feature. It is understandable that this relationship was not declared in the CDL because of the following problem: The mapping of a BOCA relationship declaration to server IDL (rather than to meta-object IDL) yields a set of operations. A redefinition of the same relationship in subtypes would be, essentially, a covariant specialization, redefining the set operations of operations in the subtype. If the redefinition of the relationship narrows the target type then the mapped operations in the server IDL are also redefined such that their parameter types are narrower. Since IDL does not allow redefinition of an operation in a subtype (as does, for example, Eiffel), BOCA specifically prohibits this form of covariant redefinition in static subtypes and, as a corollary, cannot allow this form of redefinition of a relationship in a static subtype. (Note: This is allowed in dynamic subtypes, i.e. those with a RoleOf relationship to another type.) There has been some debate about how to handle this unfortunate limitation imposed by the necessity to map to the legacy IDL meta-model. Recommendation: CorbaUnion should redefine the has_feature relationship it inherits from FeatureOwner by adding a constraint saying that the relationship can be populated only with CorbaUnionMember instances. CorbaUnionMember should redefine the defines relationship it inherits from Feature by adding a constraint saying that the relationship can be populated only with a CorbaUnion instance. Explanation: BOCA specifically permits adding constraints to features in static subtypes, because constraints don't affect the server IDL operations and attributes that are generated. In general, this should be the approach to working around the prohibition on narrowing the parameter types of features when they are redefined in subtypes, including the redefinition of attributes, operations, and relationshipsrowing the types referenced by the features directly, constraints that in effect narrow the types should be declared. Note!: It is not clear whether BOCA expressions support testing the type of an element. If they do not, an appropriate upgrade to expression capabilities will be needed (see issue 63)