Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Support for UML 2 collaborations
Support for UML 2 collaborations [message #51360] Thu, 28 February 2008 13:22 Go to next message
Eclipse UserFriend
Originally posted by: gus.gmail.com

Hi!

Is it possible to check constraints on UML 2 collaborations and
collaboration-uses with the current MDT OCL parser, and more specifically,
with the OCL interpreter that is delivered as an example project?

Gustavo
Re: Support for UML 2 collaborations [message #51388 is a reply to message #51360] Thu, 28 February 2008 14:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Gustavo,

Yes, this should work fine. Collaborations are StructuredClassifiers, so
many of the same kinds of constraints defined on Classes should work with
them, too.

CollaborationUses are an different matter. Being simply NamedElements that
reference a Collaboration and define role bindings for it, it cannot own
constraints. However, normally your constraints would be defined by the
Collaboration that is a use's type, so I'm not sure what you're looking for
specifically.

Are you asking because you are having some problems?

Cheers,

Christian


Gustavo wrote:

> Hi!
>
> Is it possible to check constraints on UML 2 collaborations and
> collaboration-uses with the current MDT OCL parser, and more specifically,
> with the OCL interpreter that is delivered as an example project?
>
> Gustavo
Re: Support for UML 2 collaborations [message #51444 is a reply to message #51388] Thu, 28 February 2008 15:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gus.gmail.com

Thanks Christian!

I agree that the constraints will normally be defined for a collaboration.
But in some cases we may also want to say something about the instances
playing the roles of the collaboration. That instances are determined by
the binding imposed by a CollaborationUse. I was wondering then if it is
possible to refer to such instances and how.

Gustavo
Re: Support for UML 2 collaborations [message #51496 is a reply to message #51444] Thu, 28 February 2008 16:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Gustavo,

I see. I suppose that, in that case, it will be up to the Classifier
context that binds the roles of the CollaborationUse to define constraints
on it. And this classifier would naturally have access to the roles that
it supplies to these bindings.

HTH,

Christian

Gustavo wrote:

> Thanks Christian!
>
> I agree that the constraints will normally be defined for a collaboration.
> But in some cases we may also want to say something about the instances
> playing the roles of the collaboration. That instances are determined by
> the binding imposed by a CollaborationUse. I was wondering then if it is
> possible to refer to such instances and how.
>
> Gustavo
Re: Support for UML 2 collaborations [message #51570 is a reply to message #51496] Thu, 28 February 2008 18:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gus.gmail.com

Christian, I am not completely sure if I understand what you mean when you
say "it will be up to the Classifier context that binds the roles of the
CollaborationUse to define constraints on it".
Let us suppose that I have a StructuredClassifier SC with internal parts
Part1, Part2. I also have a collaboration C with two roles Role1 and
Role2, and use a collaboration use to bind Role1 to Part1 and Role2 to
Part2.
Do you mean that I should specify the constraint in the context of SC, or
in the context of Part1/Part2? In any of the cases, I cannot see how I
could refer to the roles of the collaboration, since this implies
navigating a dependency (i.e. the role binding) and this is not possible,
is it?

Thanks again!
Re: Support for UML 2 collaborations [message #52287 is a reply to message #51570] Wed, 05 March 2008 14:22 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Gustavo,

I understand what it would mean for SC to define constraints involving Part1
and Part2, and I understand what it would mean for C to define constraints
involving Role1 and Role2. I'm not sure that it makes sense to me, to
define a constraint on, say Part1, that makes reference to Role1. IMO,
role bindings should not have been defines as Dependencies, because I don't
think it makes sense that a part should "know about" the role that it plays
in a collaboration use. This is a similar problem to the bidirectionality
issue in the ConnecableElement-ConnectorEnd association that is currently
before the UML2 RTF.

This is a long way of saying that I'm not convinced that the kind of
constraint you are trying to express makes sense :-)

Anyways, as a CollaborationUse is not a feature of the classifier (in this
case, SC) that owns it, OCL has no access to information about the
CollaborationUse or any role bindings. Nor can it determine, from the
CollaborationUse, what the Collaboration is in order to access its roles.

So, you are correct that this is not possible with OCL. I think it's not
something that OCL would actually be interested in, anyway, as
Collaborations aren't really a part of the type system of the software
system being modeled. They aren't manifest at run-time.

Cheers,

Christian


Gustavo wrote:

> Christian, I am not completely sure if I understand what you mean when you
> say "it will be up to the Classifier context that binds the roles of the
> CollaborationUse to define constraints on it".
> Let us suppose that I have a StructuredClassifier SC with internal parts
> Part1, Part2. I also have a collaboration C with two roles Role1 and
> Role2, and use a collaboration use to bind Role1 to Part1 and Role2 to
> Part2.
> Do you mean that I should specify the constraint in the context of SC, or
> in the context of Part1/Part2? In any of the cases, I cannot see how I
> could refer to the roles of the collaboration, since this implies
> navigating a dependency (i.e. the role binding) and this is not possible,
> is it?
>
> Thanks again!
Previous Topic:converting a integer to a string.
Next Topic:Creating context-free queries
Goto Forum:
  


Current Time: Tue Apr 23 07:33:11 GMT 2024

Powered by FUDForum. Page generated in 0.03789 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top