OCL XOR link constraint [message #635794] |
Thu, 28 October 2010 07:48 |
|
We're developing a tool to model the Feature metamodel of Software
Product Lines using GMF. A Feature model allows us to specify
requirements of a product-line in terms of optional/mandatory
features (i.e. a requirement or a set of requirements that are
optional or mandatory when the product-line is derived in a particular application).
The metamodel has an abstract Feature class, of which inherits 2 subtypes of features: SolitaryFeature and GroupedFeature.
There are two association relationship between the Feature class
and the SolitaryFeature that define the relations:
- a Feature /has_optional/ SolitaryFeature,
- a Feature /has_mandatory/ SolitaryFeature.
We need an OCL constraint to define a XOR between these two
relations. The OCL we have implemented is placed in the TARGET END CONSTRAINT INTO A OUR LINK CONSTRAINT (has_optional and has_mandatory). The OCL is the following:
"(oppositeEnd.has_optional=oppositeEnd.has_mandatory)"
The problem to solve is that the OCL constraint involves the
abstract Feature class in such a way that:
a SolitaryFeature1 only can be related with an optional or mandatory
relation with other SolitaryFeature2, but the constraint also
affects to a SolitaryFeature3, in such a way that SolitaryFeature1
cannot be related neither through a optional relation nor a
mandatory relation.
diagram:
http://picasaweb.google.es/108058820701013776061/Desktop#553 2698820872976066
thanks
[Updated on: Fri, 29 October 2010 07:47] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02897 seconds