Re: A question on OCL



Re: A question on OCL

From: Pieter Van Gorp <pietervangorp_at_gmail.com>
Date: Thu, 18 Dec 2008 10:08:42 +0100
Message-ID: <15af5f050812180108l25bc0d64lf42827909b11db02@mail.gmail.com>
Dear Arnon,

On Thu, Dec 18, 2008 at 9:35 AM, Arnon Sturm <sturm@bgu.ac.il> wrote:
> 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.
You can use allInstances on the classes of those model elements, and
compare attribute values of iterators (in forAll, exists expressions)
or those of tuple elements (when using an OCL 2 product).  Perhaps you
can send a class diagram of the concrete data structure you have in
mind?

> 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'.
To me, it seems like in your example there actually *is* a path, since
the ``system'' concept aggregates both items and persons.  Especially,
since you mention a ``particular'' system, I presume you are thinking
of having several ``system'' instances and therefore an explicit class
related to that system concept.

Sincerely,
-- 
Pieter Van Gorp
  Assistant Professor (Universitair Docent)
  Information Systems Group
  School of Industrial Engineering
  Eindhoven University of Technology (TU/e)
  Office: Pav.D12
  P.O. Box 513, 5600 MB Eindhoven
  The Netherlands
  Phone: +31 40 247 2062
  Skype ID: pvgorp
  Fax: +31 40 243 2612
  http://is.tm.tue.nl/staff/pvgorp/
  http://www.pietervangorp.com/
  http://motmot.sourceforge.net/
Received on Thu 18 Dec 2008 - 09:11:21 GMT