Bug 511780 - [UML-RT] Support for UML-RT style of redefinition for operations
Summary: [UML-RT] Support for UML-RT style of redefinition for operations
Status: NEW
Alias: None
Product: Papyrus-rt
Classification: Modeling
Component: core (show other bugs)
Version: 0.8.0   Edit
Hardware: PC Windows 7
: P3 normal
Target Milestone: 1.0.2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: readme
Depends on:
Blocks: 512589
  Show dependency tree
 
Reported: 2017-02-06 11:47 EST by Peter Cigehn CLA
Modified: 2017-10-17 14:35 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Cigehn CLA 2017-02-06 11:47:24 EST
This is a continued elaboration regarding the aspect of redefining ordinary operations owned by capsules and classes, see Bug 507552 Comment 8. In the legacy tooling the support for redefining operations is only using the limited redefinition support in base UML, i.e. whenever an operation is redefined, its parameter list gets copied, and duplicated, into the subclass. 

So the principle in UML-RT where as little as possible is persisted in the subclass, to avoid duplication, and everything else is inherited from the supercass is not used. The UML-RT specific stereotype RTRedefinedElement, with the rootFragment references is not being used either, only the ordinary redefinedElement/redefinedOperation reference in base UML is beign used.

It should be elaborated, and probably clarified in the UML-RT profile document, which principle should be used in UML-RT for Papyrus-RT.

It is probably beneficial if the same redefinition principle with limited duplication in the subclass can be used for operations as well, including the consistent use of the RTRedefinedElement stereotype to indicate the redefinition.

The main use case for redefinition of operations in UML-RT, when C++ is used as action language, is to perform an override of a virtual function, i.e. the same name and exactly the same parameter list, and you only override the body of the function. It would then of course be beneficial if the parameter list simply was inherited from the operation in superclass, instead of duplicating it.

It should probably be elaborated also whether there is a need for an explicit redefine action on the operation. In the legacy tooling, this is done by right clicking on the inherited operation in the list of operations in the properties view (see Bug 507530 for improvements in the properties view for a capsule to include the list operations, including the inherited operations) and select "Redefine Operation", which creates a redefined operation, with a copy of the parameter list from the superclass operation, including an "empty" opaque behavior (with a TODO comment), which can directly edited in the code snippet view (see  Bug 494288 regarding the code snippet view).

This is however not very consistent to other "gestures" for redefining other elements, e.g. the effect code of a transitions, where the user simply edits the effect code in the code snippet view, and the redefinition of the transition and its effect code is done automatically simply based on the edit gesture of the effect code. The same principle could be used also for redefining an operation, i.e. when you select the inherited operation in the list of operations in the properties view for a capsule/class, and you simply start edit the body code of the operation, then the redefinition is established in the corresponding way as for a transition.
Comment 1 Peter Cigehn CLA 2017-02-06 11:53:42 EST
The aspect of importing legacy models must of course also be considered, since any legacy model will only support redefinition according to base UML with a duplicated parameter list. So we will need to support both styles of redefinition, e.g. the code-generator should support both styles. But if the UML-RT specific implementation of the UML meta-model, and possibly the facade API, provides good support also for redefined operations, i.e. the inherited list of parameters is returned in both cases disregarding if it is implicitly inherited or explicitly duplicated (as done by the legacy tooling) and the code-generator should not have to bother about the difference.
Comment 2 Peter Cigehn CLA 2017-02-06 11:58:57 EST
A clarification: The discussion in this bug is specifically related to redefining ordinary operations owned by capsules and classes. 

For the special case of redefining protocol messages (and thus implicitly its internal operation), the aspects defined in Bug 507282 Comment 22 shall be considered.
Comment 3 Ernesto Posse CLA 2017-10-17 14:35:34 EDT
Mass changing all 1.0.1 bugs to target milestone 1.0.2, because Bug 520039 depends on Bug 526168 which depends on Bug 526167 which modifies plugin MANIFEST files and therefore requires a new service version number in accordance to the guidelines at https://wiki.eclipse.org/Version_Numbering#When_to_change_the_service_segment. Hence the solution to these bugs must be merged as a new version (1.0.1) and therefore all old 1.0.1 bugs should become 1.0.2.