Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Additional Operation for uml::Classifier (meta model)
Additional Operation for uml::Classifier (meta model) [message #652457] Fri, 04 February 2011 01:22 Go to next message
Kirsten M. Z. is currently offline Kirsten M. Z.Friend
Messages: 131
Registered: July 2010
Senior Member
Hi @all,

I am wondering, if it is possible to add operations to meta classes of the UML meta model by using the "middleweight extension" approach (cp. Customizing UML).

The document mentions that it is possible to add operations using this approach. I am wondering, if this statement refers to operations of new (maybe derived) meta classes only, or if it is possible to refine existing meta classes. In my case, I want to add an operation to uml::Classifier. Maybe, the UML genmodel offers a "refinement trick" (like subsetting, union, etc.) for doing this.

This would be neat, because I am using different model transformation languages (namely, Acceleo and QVTo) which are able to call such operations. By adding methods to UML meta classes, I am able to "share functionality" among my model transformations.

Thanks!

[Updated on: Sat, 05 February 2011 10:22]

Report message to a moderator

Re: Additional Operation for uml::Classifier (meta model) [message #652540 is a reply to message #652457] Fri, 04 February 2011 13:27 Go to previous messageGo to next message
Vlad Varnica is currently offline Vlad VarnicaFriend
Messages: 546
Registered: July 2009
Location: Milton Keynes - UK
Senior Member
You can try to use the EclipseUML Editor from the UML2 open source project. I mean open the .uml model with the editor, then add your method and save it.
Your .uml should have been updated.

What I don't know is how it works after because I only use Java language and code is live synchronized with the model metaclass.
Hope this help.
Re: Additional Operation for uml::Classifier (meta model) [message #652687 is a reply to message #652540] Sat, 05 February 2011 10:21 Go to previous messageGo to next message
Kirsten M. Z. is currently offline Kirsten M. Z.Friend
Messages: 131
Registered: July 2010
Senior Member
Quote:
You can try to use the EclipseUML Editor from the UML2 open source project. I mean open the .uml model with the editor, then add your method and save it.
Your .uml should have been updated.


You mean opening the original "UML.metamodel.uml"? Well, I don't want to do this. According to Customizing UML, this would be a "heavyweight extension". No, I want to add my operation "from outside". I thought, that there are maybe techniques like "refinement" or "package merge" for such tasks. I cannot find detailed statements what's possible with this techniques and what is not possible (e.g. adding operations to existing meta classes).
Re: Additional Operation for uml::Classifier (meta model) [message #652786 is a reply to message #652687] Sun, 06 February 2011 18:30 Go to previous messageGo to next message
Vlad Varnica is currently offline Vlad VarnicaFriend
Messages: 546
Registered: July 2009
Location: Milton Keynes - UK
Senior Member
This is just a 2minutes job adding a method directly at the metamodel level. It works well.
There should be other alternatives but I don't know about them.
Good luck for your project.

[Updated on: Sun, 06 February 2011 18:31]

Report message to a moderator

Re: Additional Operation for uml::Classifier (meta model) [message #652959 is a reply to message #652786] Mon, 07 February 2011 18:32 Go to previous message
Kirsten M. Z. is currently offline Kirsten M. Z.Friend
Messages: 131
Registered: July 2010
Senior Member
Well, I know. However, I don't want to change the original meta model. I want to extend the UML meta model using an external meta model.

I already accomplished to use package merges now (so merging the UML meta model with my meta model which defines a new operation for uml::Classifier). However, this does not fit expectations completely. First, the workflow for merging packages is not trivial. Second, the resulting meta model does not seem to have all features of the original UML meta model (seems that many operation implementations are gone). I know that there are solutions for such problems... but I want to avoid working for weeks in order to get a stable workflow. All in all, package merges are not a good solution for me.

Currently, I am trying another approach. After some work, I already got a working example and maybe I should proceed with that approach:
I am using a profile and stereotypes!
Thereby, a stereotype for uml::Classifier owns the operations I need. Of course, the operation must use "base_Classifier" instead of "self" as context. And another important fact is that this stereotype must be applied for all according elements of the model (at least elements which shall provide enhanced functionality).

I am happy that this approach seems to work, because recently I read that some transformation engines cannot deal with operations defined for stereotypes.
Previous Topic:How do you specify a Type when calling Parameter.setType(Type)?
Next Topic:Re: genmodel for state machine diagram
Goto Forum:
  


Current Time: Mon Dec 29 03:15:30 GMT 2014

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

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