Proposed criteria for editing property subsets and element redefinitions [message #626584] |
Mon, 19 May 2008 14:31 |
Eclipse User |
|
|
|
With org.eclipse.emf.edit.ui.celleditor.FeatureEditorDialog, the UML
Editor could have user-friendly support for editing property subsets and
element redefinitions where applicable.
To be effective, this would need reasonable queries to identify
all of the possible elements that could be subsetted or redefined
respectively.
What do you think of the following criteria for selecting property subsets?
context uml::Property : Bag(uml::Property)
body:
let cls:Bag(uml::Classifier)=self.featuringClassifier
.oclAsType(uml::Classifier) in
let parents:Bag(uml::Classifier)=cls->union(cls.allParents()) in
let prop:Bag(uml::Feature)=cls.allFeatures()
->intersection(parents.ownedMember->select(oclIsKindOf(uml::Feature))
->collect(oclAsType(uml::Feature)))->excluding(self)
->select(oclIsKindOf(uml::Property)) in
prop->select(let p:uml::Property=oclAsType(uml::Property) in
self.type.conformsTo(p.type))
What do you think of the following criteria for selecting element
redefinitions?
context uml::RedefinableElement : Bag(uml::RedefinableElement)
body:
if self.oclIsKindOf(uml::Property) then
let cls:Bag(uml::Classifier)=self.featuringClassifier
.oclAsType(uml::Classifier) in
let parents:Bag(uml::Classifier)=cls->union(cls.allParents()) in
let redefProp:Bag(uml::Feature)=parents.allFeatures()
->select(f|
f.oclIsKindOf(uml::Property) and
self.type.conformsTo(f.oclAsType(uml::Property).type))->asBag()
->intersection(parents.ownedMember
->select(oclIsKindOf(uml::Property))
->collect(oclAsType(uml::Property))
->excluding(self.oclAsType(uml::Property))
->asBag())
in redefProp
else
if self.oclIsKindOf(uml::Operation) then
let cls:Bag(uml::Classifier)=self.featuringClassifier
.oclAsType(uml::Classifier) in
let parents:Bag(uml::Classifier)=cls->union(cls.allParents()) in
let redefOp:Bag(uml::Feature)=parents.allFeatures()
->select(o|
o.oclIsKindOf(uml::Operation) and
self.type.conformsTo(o.oclAsType(uml::Operation).type))->asBag()
->intersection(parents.ownedMember
->select(oclIsKindOf(uml::Operation))
->collect(oclAsType(uml::Operation)
->excluding(self.oclAsType(uml::Operation))
->asBag())
in redefOp
else
Set{}
endif
endif
-- Nicolas.
|
|
|
Powered by
FUDForum. Page generated in 0.02520 seconds