Following the OO paradigm in papyrus [message #1830046] |
Thu, 16 July 2020 05:37  |
Eclipse User |
|
|
|
This is an "high level" question:
I have a set of methods, like getInputPortsNames(Class umlClass) in one big utility class.
I would like to follow the Object Oriented Paradigm, avoiding utility classes, calling directly the methods as follows:
umlClass.getInputPortsNames();
Is there a way to "embed" additional methods into the UML elements.
Many thanks for the help!
|
|
|
|
|
|
|
|
|
|
|
|
Re: Following the OO paradigm in papyrus [message #1830258 is a reply to message #1830187] |
Wed, 22 July 2020 04:46   |
Eclipse User |
|
|
|
- The registry EPackageRegistry has stored the entity <FactoryId, FactoryInstance> i.e. <UMLPackage.eNS_URI, instance of UMLFactoryImpl>
- In Papyrus, the EPackageRegistry is retrieved by looking at the property 'org.eclipse.emf.ecore.EPackage.Registry.INSTANCE'.
I proceeded as follows:
- I created the class MyUMLFactory that extends UMLFactory.
- The key action was to put the entity <UMLPackage.eNS_URI, instance of MyUMLFactory> in the EPackageRegistry.
- I created the registry MyRegistry that extends EPackageRegistryImpl and adds the entity <UMLPackage.eNS_URI, instance of MyUMLFactory>
- Then, for the execution of my software that is build on top of Papyrus, in the VMArgument I added "-Dorg.eclipse.emf.ecore.EPackage.Registry.INSTANCE="extendeduml.MyRegistry""
In this way, each invocation of UMLFactory is replaced with the invocation of MyUMLFactory.
[Updated on: Wed, 22 July 2020 05:01] by Moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.30179 seconds