Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Proposed criteria for editing property subsets and element redefinitions
Proposed criteria for editing property subsets and element redefinitions [message #626584] Mon, 19 May 2008 14:31
Nicolas Rouquette is currently offline Nicolas Rouquette
Messages: 132
Registered: July 2009
Senior Member
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.
Previous Topic:Re: Programmatically moving Packages within an UML model
Next Topic:Re: Programmatically moving Packages within an UML model
Goto Forum:
  


Current Time: Mon Apr 21 11:41:33 EDT 2014

Powered by FUDForum. Page generated in 0.01888 seconds