Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Why is there no runtime adapter which provides IProject from IResource.(Why is there no runtime adapter which provides IProject from IResource.)
Why is there no runtime adapter which provides IProject from IResource. [message #755313] Tue, 08 November 2011 00:06 Go to next message
Jeeeyul Lee is currently offline Jeeeyul Lee
Messages: 108
Registered: July 2009
Location: Seoul
Senior Member

I know I can just make it in ease, but just curious.

Why is there no runtime adapter which provides IProject from IResource.

I think there is may be some dangerous reason for it.
Re: Why is there no runtime adapter which provides IProject from IResource. [message #755373 is a reply to message #755313] Tue, 08 November 2011 04:54 Go to previous message
Daniel Krügler is currently offline Daniel Krügler
Messages: 853
Registered: July 2009
Senior Member
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,

Daniel Krügler
Previous Topic:Generate Eclipse Product to Linux from Windows
Next Topic:How to Execute a Listener on Open Project
Goto Forum:
  


Current Time: Thu Jul 24 23:53:21 EDT 2014

Powered by FUDForum. Page generated in 0.03225 seconds