Support for UML 2 collaborations [message #51360] |
Thu, 28 February 2008 08:22  |
Eclipse User |
|
|
|
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 09:17   |
Eclipse User |
|
|
|
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 #52287 is a reply to message #51570] |
Wed, 05 March 2008 09:22  |
Eclipse User |
|
|
|
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!
|
|
|
Powered by
FUDForum. Page generated in 0.03866 seconds