I have the following problem.
I have small EMF model with root element Rack.
In this Rack I have feature called 'devices' of type Device.
Device is an abstract class and I want to extend this class
in other EMF models from different plugins using extension point in this
plugin.
I want to have Simatic->Device, ModbusNet->Device ...
My question is: What is the best way to extend the basic EMF model with
additionall EMF models and to have them all in the editor of the basic
model?
My solution does not satisfy me. Here follows description of what I have
made.
In the extension point I require the extensions to declare:
- factoryClass - The class responsible for creating Device subclass
instances
- factoryMethod - The name of the creation method in the factory
Using the provided information I am able to create instances of the
specific devices but I loose the
functionality provided by the corresponding edit plugin - ItemProviders,
ItemProviderAdapterFactory.
As final result I am able to create child devices of the Rack which are
taken from the extension point but I don't have their images and property
categories.
A colegue of mine advice me to require 'adapterFactoryClass' in the
extension point but I thinkg maybe someone knows better approach of
dynamically extending EMF model.