instantiating a class from another plugin [message #307756] |
Wed, 30 August 2006 13:51  |
Eclipse User |
|
|
|
Originally posted by: vik_ram.hotmail.com
Hi,
Is it possible to instantiate a class from another plugin without
defining a dependency on that plugin.
The way our product is bundled is that we may ship plugin A alone OR
plugin A and plugin B. plugin B depends on plugin A but plugin A can run
independently. We want to define a documentProvider common to both
plugins - so we define it in plugin A. The problem is that the
documentProvider class should be able to invoke classes in both A and B
depending on certain criteria ( strategy pattern ) . But as it is
defined in plugin A , it cannot instantiate classes in plugin B.
Thanks,
Vikram
|
|
|
|
|
|
Re: instantiating a class from another plugin [message #307761 is a reply to message #307760] |
Wed, 30 August 2006 15:05  |
Eclipse User |
|
|
|
Originally posted by: vik_ram.hotmail.com
Rich, Paul and Ed,
Thanks for the responses.
Ed Merks wrote:
> Vikram,
>
> I agree with Rich's good advice.
> But here's a way you could load classes without using an extension point.
>
> Bundle xsdPlugin = Platform.getBundle("org.eclipse.xsd");
> if (xsdPlugin != null)
> {
> try
> {
> Class theGeneratorClass =
> xsdPlugin.loadClass
> ("org.eclipse.xsd.ecore.Ecore" + type + "SchemaBuilder");
>
>
> vikram wrote:
>
>> Hi,
>>
>> Is it possible to instantiate a class from another plugin without
>> defining a dependency on that plugin.
>>
>> The way our product is bundled is that we may ship plugin A alone OR
>> plugin A and plugin B. plugin B depends on plugin A but plugin A can
>> run independently. We want to define a documentProvider common to
>> both plugins - so we define it in plugin A. The problem is that the
>> documentProvider class should be able to invoke classes in both A and
>> B depending on certain criteria ( strategy pattern ) . But as it is
>> defined in plugin A , it cannot instantiate classes in plugin B.
>>
>> Thanks,
>> Vikram
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03515 seconds