Re: A question on OCL



Re: A question on OCL

From: Robert France <france_at_CS.ColoState.EDU>
Date: Thu, 18 Dec 2008 10:14:30 -0700
Message-ID: <494A84F6.3050008@cs.colostate.edu>
I agree with Tony. A constraint determines (or is based on) 
relationships among the elements it references.
It makes sense to describe the relationships as (for example) 
associations in a more conceptual class model.

Its also important to understand how the constraint is checked/enforced 
in an implementation model - for this reason, you may also see 
relationships (associations, dependencies) in the implementation model 
that are used in descriptions of constraint checking/enforcement 
functionality.

Robert

Anthony Simons wrote:
> 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
>

-- 
Robert B. France, Professor       | Tel: 970-491-6356
Computer Science Department       | Fax: 970-491-2466
Colorado State University         | Email: france@cs.colostate.edu
Fort Collins, CO 80523            | www.cs.colostate.edu/~france/
Received on Thu 18 Dec 2008 - 17:14:45 GMT