[nbdev] Re: DataLoaders Bridge Proposal

  • From: Jesse Glick < >
  • To:
  • Subject: [nbdev] Re: DataLoaders Bridge Proposal
  • Date: Wed, 29 Feb 2012 15:02:06 -0500
  • Organization: Oracle Corp. / NetBeans

On 02/28/2012 04:44 PM, Emilian Bold wrote:
it's easy to spot some module doing DataObject.find(file) and
notice that they just want to get a Cookie. But if we make FileObject a
Lookup.Provider then this is a bit harder to track

Why? Just search for FileObject.getLookup.

As far as upgrading module code to use the new idiom, many cases would be 
covered by a Jackpot hint

org.openide.loaders.DataObject.find($fo).getLookup()
:: $fo instanceof org.openide.filesystems.FileObject
=>
$fo.getLookup()
;

I also see Lookup.Provider as a very demanding interface
[because it] has to support a LookupListener.

True, but this is a potential advantage for the caller, and implementing it is not generally difficult since there are many convenience implementations in the openide.util.lookup. In the case of the DataObject bridge, the implementation is trivial since it can simply call DataObject.find(f).getLookup() and be done.



[nbdev] DataLoaders Bridge Proposal

Emilian Bold 02/28/2012

[nbdev] Re: DataLoaders Bridge Proposal

Jesse Glick 02/28/2012

[nbdev] Re: DataLoaders Bridge Proposal

Emilian Bold 02/28/2012

[nbdev] Re: DataLoaders Bridge Proposal

Jesse Glick 02/29/2012

Project Features

About this Project

www was started in November 2009, is owned by jpirek, and has 21 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close