RE: A question on OCL



RE: A question on OCL

From: Jorn Guy Suess <jgsuess_at_itee.uq.edu.au>
Date: Thu, 18 Dec 2008 20:14:44 +1000
Message-ID: <DFA741BE6218FD4B8D9CE78434D60AAE01808100@UQEXMB3.soe.uq.edu.au>
Arnon,

 

As has been advised allInstances() is the technical way to do it. However, there is a formal catch: What is the total set of instances you have? In a technical system (a MOF repository) this set is a closed extent. Mathematically, the set is usually infinite. So queries of that are a bit of a high-ball. The more instances you load into a repository, the more drastic these effects become. I assume your question alludes to profiles. You will find that after the third or fourth class drawn into such a Cartesian product, evaluation is quite sluggish.

 

Kind regards,

 

Jrn Guy S

 

From: puml-list-request@cs.york.ac.uk [mailto:puml-list-request@cs.york.ac.uk] On Behalf Of Arnon Sturm
Sent: Thursday, 18 December 2008 18:36
To: puml-list@cs.york.ac.uk
Subject: A question on OCL

 

All,

 

I wonder whether it is possible to specify an OCL constraint on two or more model elements which do not have a navigation path among them.

 

For example, in case of a library system we have two "unrelated" classes: item and person.

I would like to specify the follwoing constraint: if the items of a particular system are all of type 'journal' or 'proceeding', then all the persons in this system are of type 'faculty'.

 

For sure, there is the possibility to define a "mediator" class that will create navigation paths. However, we are interested in specifying the constraint without that "mediator" class.

 

Thanks for your help,

 

Arnon Sturm
Received on Thu 18 Dec 2008 - 10:14:55 GMT