Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » How to display inherited operations to specialize their behavior?(displaying operations)
How to display inherited operations to specialize their behavior? [message #913036] Fri, 14 September 2012 16:39 Go to next message
Gabriela Bosetti is currently offline Gabriela BosettiFriend
Messages: 1
Registered: September 2012
Junior Member
I need to specialize the behavior of two classes derived from an abstract. In the abstract class I have an operation called "calcularPrecio", which is responsible for calculating the price of an item based on the type of customer it acquires. So, it's important to visualize this method in the specialized classes.

One way is creating one operation for each class, because it can't allow to copy-paste. This is quite tedious because if the operation has parameters, I have to create one operation three times, and then three times each parameter (one for each operation).

So, my question is: how to display inherited operations in specialized classes in a non-complicated way?

I used to use BOUML and when I did right click on the specialized class you can select methods and then say "inherit" and all them appears on the class.
Re: How to display inherited operations to specialize their behavior? [message #915421 is a reply to message #913036] Mon, 17 September 2012 08:32 Go to previous message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 511
Registered: February 2011
Senior Member
Hello Gabriela,


There's currently a lack of support for redefining/overridding (and copying) operations in Papyrus, which will need to be fixed. Until then, I can suggest a workaround:

- Create an operation in the Super class
- Add the parameters
- Use the ModelExplorer to make a copy-paste of the operation to your subclasses
- Drop the new operations to your diagram to make them visible

That's still not simple, but at least is it "less complicated" than re-creating the operations and parameters.


Papyrus also allows you to display an inherited operation via the "Filters" / "Show/hide contents" menu. However, it is only useful for displaying the operations. If you want to override them, you will need to make an actual copy.


Regards,
Camille


Camille Letavernier
Papyrus developer
Previous Topic:Can't install Diagram Style Sheets
Next Topic:Register for Mailing List
Goto Forum:
  


Current Time: Mon Dec 22 16:37:31 GMT 2014

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

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