Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Re: general ocl question
Re: general ocl question [message #472997] Fri, 25 May 2007 13:57 Go to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Nick,

I think these questions are for the UML2 component, which newsgroup I have
included in my reply. However, I think I can answer ...

The UML2 component's implementation of UML 2.1 includes only those
constraints that are specified in the OMG's Rose model. It is my
understanding that the Rose model does not include the majority of the
constraints that are listed in the Specification document.

UML2 implements these constraints in Java; they were "transformed" manually
from OCL. In some cases, even correcting errors in the OCL specification
of the constraint. These constraints are not evaluated on-the-fly, but
when the user selects the "Validate..." action in the UML editor.

The UML2 component does support the definition of invariant constraints and
operation bodies on Stereotypes, in the Java language as per standard EMF
code generation. Since 2.1 M7, it additionally supports OCL constraints,
generating code that uses the MDT OCL implementation. Note, however, that
both of these options only apply to statically-defined profiles, in which
you generate an EMF package implementating the profile.

The UML2 newsgroup can answer any further questions that you may have.

HTH,

Christian

Nick Kirtley wrote:

> Hi,
>
> I'm working on a project and will need to work with ocl extensively.
>
> Firstly I would like to make sure that when I create models in UML2 that
> they adhere to the normal uml constraints. Are they all validated in
> realtime? ie when I add entities in a class diagram that I cannot connect
> them in an improper way?
>
> I'm going to be extending the uml metamodel and would like to add my own
> constraints to the stereotypes that I create. Can this be easily achieved
> in java code?
>
> Have any extra constraints been used in the project ? these could have
> been used to look at extra constraints within models.
>
>
> thx,
>
> Nick
Re: general ocl question [message #473007 is a reply to message #472997] Fri, 25 May 2007 20:12 Go to previous messageGo to next message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Christian,

To clarify, only a subset of the constraints that are defined in the source
model (an RSM model, actually, as of UML 2.1) for the specification (which I
believe includes almost all of them now, although OCL is not provided for
many/most of them) are implemented in UML2. We have an enhancement request
open for this (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=80307), and
we are looking for the community's help with implementing them -
contributions are always welcome!

Kenn

"Christian W. Damus" <cdamus@ca.ibm.com> wrote in message
news:f36q0f$jqr$1@build.eclipse.org...
> Hi, Nick,
>
> I think these questions are for the UML2 component, which newsgroup I have
> included in my reply. However, I think I can answer ...
>
> The UML2 component's implementation of UML 2.1 includes only those
> constraints that are specified in the OMG's Rose model. It is my
> understanding that the Rose model does not include the majority of the
> constraints that are listed in the Specification document.
>
> UML2 implements these constraints in Java; they were "transformed"
> manually
> from OCL. In some cases, even correcting errors in the OCL specification
> of the constraint. These constraints are not evaluated on-the-fly, but
> when the user selects the "Validate..." action in the UML editor.
>
> The UML2 component does support the definition of invariant constraints
> and
> operation bodies on Stereotypes, in the Java language as per standard EMF
> code generation. Since 2.1 M7, it additionally supports OCL constraints,
> generating code that uses the MDT OCL implementation. Note, however, that
> both of these options only apply to statically-defined profiles, in which
> you generate an EMF package implementating the profile.
>
> The UML2 newsgroup can answer any further questions that you may have.
>
> HTH,
>
> Christian
>
> Nick Kirtley wrote:
>
>> Hi,
>>
>> I'm working on a project and will need to work with ocl extensively.
>>
>> Firstly I would like to make sure that when I create models in UML2 that
>> they adhere to the normal uml constraints. Are they all validated in
>> realtime? ie when I add entities in a class diagram that I cannot connect
>> them in an improper way?
>>
>> I'm going to be extending the uml metamodel and would like to add my own
>> constraints to the stereotypes that I create. Can this be easily achieved
>> in java code?
>>
>> Have any extra constraints been used in the project ? these could have
>> been used to look at extra constraints within models.
>>
>>
>> thx,
>>
>> Nick
>
Re: general ocl question [message #473018 is a reply to message #472997] Mon, 28 May 2007 14:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nickkirtley.gmail.com

Hi,

thx for your reply,

So questions regarding OCL should not be asked within mdt.ocl?

I've got a followup question:
The existing (limited) constraints are implemented in java. If for
example, I'm going to add unique component types and would like to add
constraints to the connectors. Can I do this using OCL or would I have to
implement it in Java?
Basically if I add new features, do I have to add constraints in java code
or with OCL constraints?

regards,

Nick
Re: general ocl question [message #473019 is a reply to message #473018] Mon, 28 May 2007 18:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Nick,

No, questions about the MDT OCL implementation should normally be asked on
the OCL newsgroup. It's just that your questions were about how the UML
implementation uses constraints and/or OCL.

You can implement constraints in your UML extensions (whether heavy-weight
or profile extensions) using either Java or OCL; the choice is yours. You
can even use the EMF Validation framework to define the constraints
externally (not in the model implementation) using Java, OCL, or any other
language for which a provider is plugged into that framework.

Cheers,

Christian


Nick Kirtley wrote:

> Hi,
>
> thx for your reply,
>
> So questions regarding OCL should not be asked within mdt.ocl?
>
> I've got a followup question:
> The existing (limited) constraints are implemented in java. If for
> example, I'm going to add unique component types and would like to add
> constraints to the connectors. Can I do this using OCL or would I have to
> implement it in Java?
> Basically if I add new features, do I have to add constraints in java code
> or with OCL constraints?
>
> regards,
>
> Nick
Re: general ocl question [message #473020 is a reply to message #473007] Mon, 28 May 2007 18:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Kenn,

Thanks for the correction.

So, is the OMG using RSM now, instead of Rose? The diagrams in the spec
don't look like RSM diagrams ...

Cheers,

Christian


Kenn Hussey wrote:

> Christian,
>
> To clarify, only a subset of the constraints that are defined in the
> source model (an RSM model, actually, as of UML 2.1) for the specification
> (which I believe includes almost all of them now, although OCL is not
> provided for many/most of them) are implemented in UML2. We have an
> enhancement request open for this (see
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=80307), and we are looking
> for the community's help with implementing them - contributions are always
> welcome!
>
> Kenn

<snip>
Re: general ocl question [message #473021 is a reply to message #473020] Mon, 28 May 2007 18:44 Go to previous messageGo to next message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Christian,

Yes, the diagrams in the specification were produced using RSM (you can make
a diagram look pretty-much any way you want). ;)

Kenn

"Christian W. Damus" <cdamus@ca.ibm.com> wrote in message
news:f3f5k3$dt$4@build.eclipse.org...
> Hi, Kenn,
>
> Thanks for the correction.
>
> So, is the OMG using RSM now, instead of Rose? The diagrams in the spec
> don't look like RSM diagrams ...
>
> Cheers,
>
> Christian
>
>
> Kenn Hussey wrote:
>
>> Christian,
>>
>> To clarify, only a subset of the constraints that are defined in the
>> source model (an RSM model, actually, as of UML 2.1) for the
>> specification
>> (which I believe includes almost all of them now, although OCL is not
>> provided for many/most of them) are implemented in UML2. We have an
>> enhancement request open for this (see
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=80307), and we are looking
>> for the community's help with implementing them - contributions are
>> always
>> welcome!
>>
>> Kenn
>
> <snip>
Re: general ocl question [message #473037 is a reply to message #473020] Wed, 30 May 2007 12:37 Go to previous message
Eclipse UserFriend
Originally posted by: nickkirtley.gmail.com

HI,


Is there a list of constraints that have/have not been implemented within
the UML model?

regards,

nick
Re: general ocl question [message #618141 is a reply to message #472997] Fri, 25 May 2007 20:12 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Christian,

To clarify, only a subset of the constraints that are defined in the source
model (an RSM model, actually, as of UML 2.1) for the specification (which I
believe includes almost all of them now, although OCL is not provided for
many/most of them) are implemented in UML2. We have an enhancement request
open for this (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=80307), and
we are looking for the community's help with implementing them -
contributions are always welcome!

Kenn

"Christian W. Damus" <cdamus@ca.ibm.com> wrote in message
news:f36q0f$jqr$1@build.eclipse.org...
> Hi, Nick,
>
> I think these questions are for the UML2 component, which newsgroup I have
> included in my reply. However, I think I can answer ...
>
> The UML2 component's implementation of UML 2.1 includes only those
> constraints that are specified in the OMG's Rose model. It is my
> understanding that the Rose model does not include the majority of the
> constraints that are listed in the Specification document.
>
> UML2 implements these constraints in Java; they were "transformed"
> manually
> from OCL. In some cases, even correcting errors in the OCL specification
> of the constraint. These constraints are not evaluated on-the-fly, but
> when the user selects the "Validate..." action in the UML editor.
>
> The UML2 component does support the definition of invariant constraints
> and
> operation bodies on Stereotypes, in the Java language as per standard EMF
> code generation. Since 2.1 M7, it additionally supports OCL constraints,
> generating code that uses the MDT OCL implementation. Note, however, that
> both of these options only apply to statically-defined profiles, in which
> you generate an EMF package implementating the profile.
>
> The UML2 newsgroup can answer any further questions that you may have.
>
> HTH,
>
> Christian
>
> Nick Kirtley wrote:
>
>> Hi,
>>
>> I'm working on a project and will need to work with ocl extensively.
>>
>> Firstly I would like to make sure that when I create models in UML2 that
>> they adhere to the normal uml constraints. Are they all validated in
>> realtime? ie when I add entities in a class diagram that I cannot connect
>> them in an improper way?
>>
>> I'm going to be extending the uml metamodel and would like to add my own
>> constraints to the stereotypes that I create. Can this be easily achieved
>> in java code?
>>
>> Have any extra constraints been used in the project ? these could have
>> been used to look at extra constraints within models.
>>
>>
>> thx,
>>
>> Nick
>
Re: general ocl question [message #618166 is a reply to message #472997] Mon, 28 May 2007 14:19 Go to previous message
Eclipse UserFriend
Originally posted by: nickkirtley.gmail.com

Hi,

thx for your reply,

So questions regarding OCL should not be asked within mdt.ocl?

I've got a followup question:
The existing (limited) constraints are implemented in java. If for
example, I'm going to add unique component types and would like to add
constraints to the connectors. Can I do this using OCL or would I have to
implement it in Java?
Basically if I add new features, do I have to add constraints in java code
or with OCL constraints?

regards,

Nick
Re: general ocl question [message #618167 is a reply to message #473018] Mon, 28 May 2007 18:04 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Nick,

No, questions about the MDT OCL implementation should normally be asked on
the OCL newsgroup. It's just that your questions were about how the UML
implementation uses constraints and/or OCL.

You can implement constraints in your UML extensions (whether heavy-weight
or profile extensions) using either Java or OCL; the choice is yours. You
can even use the EMF Validation framework to define the constraints
externally (not in the model implementation) using Java, OCL, or any other
language for which a provider is plugged into that framework.

Cheers,

Christian


Nick Kirtley wrote:

> Hi,
>
> thx for your reply,
>
> So questions regarding OCL should not be asked within mdt.ocl?
>
> I've got a followup question:
> The existing (limited) constraints are implemented in java. If for
> example, I'm going to add unique component types and would like to add
> constraints to the connectors. Can I do this using OCL or would I have to
> implement it in Java?
> Basically if I add new features, do I have to add constraints in java code
> or with OCL constraints?
>
> regards,
>
> Nick
Re: general ocl question [message #618168 is a reply to message #473007] Mon, 28 May 2007 18:06 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Kenn,

Thanks for the correction.

So, is the OMG using RSM now, instead of Rose? The diagrams in the spec
don't look like RSM diagrams ...

Cheers,

Christian


Kenn Hussey wrote:

> Christian,
>
> To clarify, only a subset of the constraints that are defined in the
> source model (an RSM model, actually, as of UML 2.1) for the specification
> (which I believe includes almost all of them now, although OCL is not
> provided for many/most of them) are implemented in UML2. We have an
> enhancement request open for this (see
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=80307), and we are looking
> for the community's help with implementing them - contributions are always
> welcome!
>
> Kenn

<snip>
Re: general ocl question [message #618169 is a reply to message #473020] Mon, 28 May 2007 18:44 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Christian,

Yes, the diagrams in the specification were produced using RSM (you can make
a diagram look pretty-much any way you want). ;)

Kenn

"Christian W. Damus" <cdamus@ca.ibm.com> wrote in message
news:f3f5k3$dt$4@build.eclipse.org...
> Hi, Kenn,
>
> Thanks for the correction.
>
> So, is the OMG using RSM now, instead of Rose? The diagrams in the spec
> don't look like RSM diagrams ...
>
> Cheers,
>
> Christian
>
>
> Kenn Hussey wrote:
>
>> Christian,
>>
>> To clarify, only a subset of the constraints that are defined in the
>> source model (an RSM model, actually, as of UML 2.1) for the
>> specification
>> (which I believe includes almost all of them now, although OCL is not
>> provided for many/most of them) are implemented in UML2. We have an
>> enhancement request open for this (see
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=80307), and we are looking
>> for the community's help with implementing them - contributions are
>> always
>> welcome!
>>
>> Kenn
>
> <snip>
Re: general ocl question [message #618185 is a reply to message #473020] Wed, 30 May 2007 12:37 Go to previous message
Eclipse UserFriend
Originally posted by: nickkirtley.gmail.com

HI,


Is there a list of constraints that have/have not been implemented within
the UML model?

regards,

nick
Previous Topic:programmatic access to metamodel elements
Next Topic:programmatic access to metamodel elements
Goto Forum:
  


Current Time: Tue Apr 23 08:48:27 GMT 2024

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

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

Back to the top