Re: A question on OCL



Re: A question on OCL

From: Anthony Simons <A.Simons_at_dcs.shef.ac.uk>
Date: Thu, 18 Dec 2008 10:27:11 +0000
Message-ID: <494A257F.1040807@dcs.shef.ac.uk>
Hi Arnon,

Regarding the constraint with no navigation problem:

Isn't it the case that you have a conceptual model, which is independent 
of any navigation issues?  It seems as though your model relates Authors 
and Publications at some level.  You want to restrict certain kinds of 
Author (viz Faculty) to being associated with certain kinds of 
Publication (viz. Academic).  The normal way I would do this is to have 
a generic association from Author---Publication and a derived 
association between the subclasses which {subset} the roles in the 
first, with an OCL constraint.

This is entirely separate from the implementation model.  You don't have 
to think of the association as implying any kind of navigation from one 
class to the other. 

--Tony

========

Arnon Sturm wrote:
> 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

-- 
==========================================================================

Dr Anthony J H Simons                   a.simons@dcs.shef.ac.uk
Senior Lecturer in Computer Science     http://www.dcs.shef.ac.uk/~ajhs

Department of Computer Science          tel:  (+44) 114 22 21838
University of Sheffield                 dept: (+44) 114 22 21800
Regent Court, 211 Portobello Street     fax:  (+44) 114 22 21810
SHEFFIELD, S1 4DP                       univ: (+44) 114 22 22000
United Kingdom

==========================================================================
Received on Thu 18 Dec 2008 - 10:27:16 GMT