|Re: Why is there no runtime adapter which provides IProject from IResource. [message #755373 is a reply to message #755313]
||Tue, 08 November 2011 09:54
| Daniel KrÃ¼gler
Registered: July 2009
On 2011-11-08 06:06, Jeeeyul wrote:|
> I know I can just make it in ease, but just curious.
> Why is there no runtime adapter which provides IProject from IResource.
Correct. An IProject derives from IResource, but runtime adapters should
only be provided for types, that have no such derivation relations. The
adapter pattern is used to define a type-to-type conversion, where such
inheritance-based relations do not exist.
> I think there is may be some dangerous reason for it.
I strongly disagree for the reasons mentioned above. Proper usage of
IAdaptable should first start with an instanceof test to prevent the
potential overhead (and need) for an adaptable query.
HTH & Greetings from Bremen,
Powered by FUDForum
. Page generated in 0.01690 seconds