[great-users] Patterncardinality on connections

Aditya Agrawal Aditya at isis.vanderbilt.edu
Tue May 4 13:36:30 CDT 2004


> >I found another problem in GReAT. I want to find patterns in which
two
> >models are not connected by a given connection. However, GReAT does
not
> >check when I set the patterncardinalty to 0 corresponding to the
> >association class. Also, if the configuration fails and I click on
> >cancel instead of closing the cmd window GME crashes. This is really
> >annoying.
> >
> >
> 
> Here is my 2cents from the PROLOG world:
> Make a Test block, and in the first Case you match the connection with
> at least 1. That case should do no action and have a Cut.
> In the second Case, perform your action. The second Case will be
> executed only if the first fails.
> Would that work?

[Adi] 
This is a correct observation. We have used the test/case and cut to
implement many complex negative conditions.

> Now I have a question: what is the purpose of the pattern cardinality
on
> newly created associations?
> I suppose that if I'm creating a new association, the cardinality will
> always be 1 on the side of the new object (...how could it be
> different?), and 1..* on the side of the old object to which I'm
> attaching the new, right? I can't understand what would change if I
put
> whatever thing different from "1 and 1..*" in the new association
 
[Adi] 
There is no meaning for the pattern cardinality on newly created
associations. Actually pattern cardinality is currently restricted to
either 0 or 1 and that to 0 is only for bound pattern edges.


More information about the great-users mailing list