|Re: Following the OO paradigm in papyrus [message #1830258 is a reply to message #1830187]
||Wed, 22 July 2020 08:46
| Alberto Debiasi
Registered: March 2018
- 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.01847 seconds