Home » Modeling » UML2 » UML profile with OCL constraints on stereotypes
UML profile with OCL constraints on stereotypes [message #661357] |
Thu, 24 March 2011 10:59 |
Eclipse User |
|
|
|
Originally posted by: ss.thinkersfoot.net
Hey all,
Some background on my story can be found in a posting to the OCL newsgroup:
http://www.eclipse.org/forums/index.php?t=msg&th=206549& amp;start=0&S=6ff55f4ec2c4798b7b81aa06d74bf461
My task: In Helios (3.6.2 M20110210-1200), to have a UML profile
equipped with OCL constraints and have models applying the profile being
validated against the profile's constraints (OCL constraints written in
the context of the stereotypes).
By now, I am aware that there /might/ different approaches to this
problem (leaving aside the plans for Indigo), I took a step back and
tried the most obvious one to me; attaching constraints + opaque
behaviour (OCL + body) to the profile's stereotypes:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=105199
What I got: a UML profile, wrapped up with an EPackage stereotype
(explicitly set NS Uri!). from there, I saw two alternative paths to
take: 1) "dynamic" constraint evaluation or 2) "static" constraint
evaluation.
ad 1): By "defining" the Profile (UML Editor > Profile > Define) and
processing the "body invariants", I get an embedded ecore model of my
profile, with constraint-implementing operations (named after the
constraints).
However, as can be learnt from
https://bugs.eclipse.org/bugs/show_bug.cgi?id=105199 (last posting):
> Support for dynamically evaluating stereotype (or other) constraints will not
> be provided (at least not in UML2) since this would introduce a circular build
> dependency on MDT OCL. Besides, this a tool-level capability that would be more
> appropriately provided by the UML2 Tools component of MDT (seeing as it already
> depends on both UML2 and OCL).
So, even though, the constraints are reflected in the ecore model, they
are not put to any use. Farewell ...
ad 2) Left with static evaluation, I did the following: turned my
*.profile.uml into a *.genmodel and generated the model code. I verified
that there is not only a standalone ecore model now (with
constraint-implementing operations), but also that the
stereotype-representing Java classes have constraint-checking methods
(and dependencies on OCL packages etc.)
I then built the model code, fired up a Eclipse application, create a
UML model, apply the profile to the model (causing the EPackage and its
class set to be initialised/loaded based on the NSUri lookup), setting
the stereotype to the permissive model element. However, applying the
stereotype fails, with the base_XXX attribute not being set (in the XMI
perspective), the stereotype not showing up in the UML editor view as
"<<...>>" tag to the extended element but as dangling, alien element.
When using approach 1), applying the stereotype works. However, using
1), I don't get constraint evaluation!
So I feel trapped now ... can anybody help me out here?!
//stefan
|
|
| | | | |
Re: UML profile with OCL constraints on stereotypes [message #1064770 is a reply to message #662063] |
Thu, 20 June 2013 23:12 |
Darren Hurt Messages: 32 Registered: July 2009 |
Member |
|
|
So what on earth happened? It is now mid 2013 and Papyrus does not seem to even have a constraints tab to add OCL constraints, even though such a tab is mentioned and indeed documented (with pictures) on the papyrus uml website circa 2008!!
Is papyrus dead in the water and never likely to get these features that it appeared to once have? It would appear so, and yet it is still part of Kepler release plan with milestones in place (although constantly slipping). OCL constraints now promised for M7 in July, but I seriously doubt that will happen.....
I've been debating whether to use UML + profiling for a DSL, or go instead with my own Ecore based meta-model, and write my own editor using Graffiti or GMF etc. I was hoping to try both approaches and make substantial use of OCL. However, using OCLinEcore is fraught with problems regarding Dynamic dispatch and Pivot vs LPG issues.
Anyway it seems that progress is painfully slow and troublesome in these areas, and I am curious as to why? Has the participation dried up, and if so why? Are there better or more fashionable ways of specifying DSL's with working constraints etc.?
Forgive my ignorance. I am fairly new to mainstream (OMG ) MDA having written the majority of an entirely different generic modelling framework in a previous job that I recently left. I have to say that I am surprised and disapointed with what mainstream (OMG standards etc.) modelling through Eclipse has to offer in 2013, especially as I attended an MDA conference around 2005, and it really doesn't seem to have moved on much since, except to have sprouted many projects trying to achieve the same goals.I would say it has spread sideways rather than moving forwards!
Sorry for the rant, but I'm just frustrated that nothing is quite working well enough for my needs....
|
|
|
Re: UML profile with OCL constraints on stereotypes [message #1064913 is a reply to message #1064770] |
Fri, 21 June 2013 15:36 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
Hi
You should try the Kepler release, officially rel;eased next week, RC4
available to enthusiasts/
OCL in Profiles is supported with a rich editor. OCL in class diagrams
can generate Java code.
There is a section on editing OCL in Papyrus in the Kepler OCL
documentation.
The Papyrus constraint UI is not quite perfect; hopefully that will
improve for Luna.
Eclipse is of course free and much of the OCL support is unfunded, so
I'm sorry if you want more; there is a lot to do.
Regards
Ed Willink
On 21/06/2013 00:12, Darren Hurt wrote:
> So what on earth happened? It is now mid 2013 and Papyrus does not
> seem to even have a constraints tab to add OCL constraints, even
> though such a tab is mentioned and indeed documented (with pictures)
> on the papyrus uml website circa 2008!!
> Is papyrus dead in the water and never likely to get these features
> that it appeared to once have? It would appear so, and yet it is still
> part of Kepler release plan with milestones in place (although
> constantly slipping). OCL constraints now promised for M7 in July, but
> I seriously doubt that will happen.....
> I've been debating whether to use UML + profiling for a DSL, or go
> instead with my own Ecore based meta-model, and write my own editor
> using Graffiti or GMF etc. I was hoping to try both approaches and
> make substantial use of OCL. However, using OCLinEcore is fraught with
> problems regarding Dynamic dispatch and Pivot vs LPG issues. Anyway it
> seems that progress is painfully slow and troublesome in these areas,
> and I am curious as to why? Has the participation dried up, and if so
> why? Are there better or more fashionable ways of specifying DSL's
> with working constraints etc.?
> Forgive my ignorance. I am fairly new to mainstream (OMG ) MDA having
> written the majority of an entirely different generic modelling
> framework in a previous job that I recently left. I have to say that I
> am surprised and disapointed with what mainstream (OMG standards etc.)
> modelling through Eclipse has to offer in 2013, especially as I
> attended an MDA conference around 2005, and it really doesn't seem to
> have moved on much since, except to have sprouted many projects trying
> to achieve the same goals.I would say it has spread sideways rather
> than moving forwards!
> Sorry for the rant, but I'm just frustrated that nothing is quite
> working well enough for my needs....
>
|
|
| |
Goto Forum:
Current Time: Thu Apr 18 07:53:58 GMT 2024
Powered by FUDForum. Page generated in 0.02397 seconds
|