|Re: need guidance for execution of OCL query [message #520286 is a reply to message #519916]
||Thu, 11 March 2010 19:59
| Ed Willink
Registered: July 2009
You've given yourself a very difficult first problem.
Firstly, I would use clearer names: countFeatures() really ought to
return an Integer count, rather than just be a wrapper for an existing
Next: an invariant must be a boolean expression.
Overriding is a complex semantic issue that has different definitions in
different languages, you therefore need to understand your semantics
and realise them.
In order to determine an override you need to compare the signature of
operationA against the signature of operationB. You therefore need
helper functions such as
overrides(signatureA : OrderedSet(Type), signatureB : OrderedSet(Type))
: Boolean ...
getSignature(operation : Operation) : OrderedSet(Type) ...
which you can use in iterations/set subtractions.
You may find the MDT/OCL Example OCL Interpreter Console very helpful
for empirical exploring of your logic. As of M6, you can embed your OCL
in Ecore. See http://wiki.eclipse.org/MDT/OCLinEcore
On 10/03/2010 14:02, email@example.com wrote:
> I am new to OCL and trying to define a query to find response for a
> class. The definition on which I am working to solve for response for
> query is : number of methods plus the methods communication with other
> - first I count Operations:
> context Classifier
> def: countFeatures(): Set(Feature) =
> def: countOperation(): Set(Feature) =
> -- I look for overridden methods, because these methods also communicate
> with the class
> def: countOverriddentMethds(): Set(....) = ......// please help here
> -- and then the behvioral methods ( i mean methods which communicate
> with the other classes in sequence diagram)
> inv RFC:
> countOperation()->size()+countOverriddentMethds()->size()+countBehvioralMethods()- >size()
> I am using Topcased to execute these queries.
> Thanks in advance,
Powered by FUDForum
. Page generated in 0.03486 seconds