|
|
Re: Following the OO paradigm in papyrus [message #1830056 is a reply to message #1830055] |
Thu, 16 July 2020 13:05 |
Alberto Debiasi Messages: 84 Registered: March 2018 |
Member |
|
|
My first idea was based on the following steps:
1. Create a new profile that extends the UML profile.
2. In the profile, define a new Stereotype for example MyUMLClass that extends the element UMLClass, with the operation getInputPortsNames.
3. Then, I don't know how, replace the UMLFactory that is used to create the umlClass, with a custom factory that implements the method createClass returning the instantiated object MyUMLClass with the method getInputPortsNames.
Does it make sense to you?
[Updated on: Thu, 16 July 2020 13:05] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Re: Following the OO paradigm in papyrus [message #1830258 is a reply to message #1830187] |
Wed, 22 July 2020 08:46 |
Alberto Debiasi Messages: 84 Registered: March 2018 |
Member |
|
|
- 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 09:01] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.04237 seconds