Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Middleweight UML extension: creating specific Operations
Middleweight UML extension: creating specific Operations [message #478127] Mon, 19 January 2009 08:44 Go to next message
Eclipse UserFriend
Hello,

I am doing UML middleweight extension and I want to create a specific
UML operation for one of my classes.

That specific operation should have one Boolean parameter as input.

So I created within the UML editor a <<metaclass>> <Class> TestClass
which is a subclass of uml:Class.
I created a nested classifier <<metaclass>> <Class> testOp which is a
sublcass of uml:Operation.

Finally I added a nested classifier <<metaclass>> <Class> testParameter
which is a subclass of uml:Parameter.

But I can't set the direction and the type of testParameter. So how can
I set the set the constraint (the input parameter must be Boolean) for
the parameter ?

If I create a model instance of my metamodel, the "testOp" operation
won't show any braces in the generated editor. How can I add braces so
that one can distinguish between extended classes and extended
operations more easily.


Regards,


Deepak
Re: Middleweight UML extension: creating specific Operations [message #478135 is a reply to message #478127] Sat, 24 January 2009 20:28 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Deepak,

You should be able to set the type and direction of testParameter when you
create a M1 level model (an instance of your specialized testParameter).
The type and direction would be properties inherited from uml::Parameter.
You should be able to create OCL constraints either by adding them to the
ownedRule collection of some specialization of Namespace (i.e. Class) or you
can add preconditions to the operation that owns the parameter.

To modify the appearance of your elements, have a look at
ParameterItemProvider. You may try to override some operations such as
getText().

Cheers,
- James.



"Deepak" <dee_n@gmx.de> wrote in message
news:gl1egr$v8c$1@build.eclipse.org...
> Hello,
>
> I am doing UML middleweight extension and I want to create a specific UML
> operation for one of my classes.
>
> That specific operation should have one Boolean parameter as input.
>
> So I created within the UML editor a <<metaclass>> <Class> TestClass
> which is a subclass of uml:Class.
> I created a nested classifier <<metaclass>> <Class> testOp which is a
> sublcass of uml:Operation.
>
> Finally I added a nested classifier <<metaclass>> <Class> testParameter
> which is a subclass of uml:Parameter.
>
> But I can't set the direction and the type of testParameter. So how can I
> set the set the constraint (the input parameter must be Boolean) for the
> parameter ?
>
> If I create a model instance of my metamodel, the "testOp" operation won't
> show any braces in the generated editor. How can I add braces so that one
> can distinguish between extended classes and extended operations more
> easily.
>
>
> Regards,
>
>
> Deepak
>
>
>
>
>
>
>
>
>
>
>
>
Re: Middleweight UML extension: creating specific Operations [message #627341 is a reply to message #478127] Sat, 24 January 2009 20:28 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Deepak,

You should be able to set the type and direction of testParameter when you
create a M1 level model (an instance of your specialized testParameter).
The type and direction would be properties inherited from uml::Parameter.
You should be able to create OCL constraints either by adding them to the
ownedRule collection of some specialization of Namespace (i.e. Class) or you
can add preconditions to the operation that owns the parameter.

To modify the appearance of your elements, have a look at
ParameterItemProvider. You may try to override some operations such as
getText().

Cheers,
- James.



"Deepak" <dee_n@gmx.de> wrote in message
news:gl1egr$v8c$1@build.eclipse.org...
> Hello,
>
> I am doing UML middleweight extension and I want to create a specific UML
> operation for one of my classes.
>
> That specific operation should have one Boolean parameter as input.
>
> So I created within the UML editor a <<metaclass>> <Class> TestClass
> which is a subclass of uml:Class.
> I created a nested classifier <<metaclass>> <Class> testOp which is a
> sublcass of uml:Operation.
>
> Finally I added a nested classifier <<metaclass>> <Class> testParameter
> which is a subclass of uml:Parameter.
>
> But I can't set the direction and the type of testParameter. So how can I
> set the set the constraint (the input parameter must be Boolean) for the
> parameter ?
>
> If I create a model instance of my metamodel, the "testOp" operation won't
> show any braces in the generated editor. How can I add braces so that one
> can distinguish between extended classes and extended operations more
> easily.
>
>
> Regards,
>
>
> Deepak
>
>
>
>
>
>
>
>
>
>
>
>
Previous Topic:Why is a Port always owned by a Component?
Next Topic:foreign-method pattern for Operations
Goto Forum:
  


Current Time: Fri Apr 19 23:05:32 GMT 2024

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

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

Back to the top