API REVIEW: Weak event handler

Sven Reimers sven.reimers at gmail.com
Tue Jun 12 13:28:03 PDT 2012


Ok. Here is a link to the JavaDoc how NetBeans handles this for PropertyChanges

http://bits.netbeans.org/dev/javadoc/org-openide-util/org/openide/util/WeakListeners.html

I still do not understand the necessity for creating a new interface,
it contains no additional information (API) - for the user it can only
be used as an EventListener (assuming there will be no API explicitly
requiring WeakEventListener)..

Regards

Sven

On Tue, Jun 12, 2012 at 10:01 PM, Richard Bair <richard.bair at oracle.com> wrote:
> Hi Lubo,
>
>> I also considered to define the WeakEventHandler as an interface which extends EventHandler, but adds no additional methods. Then leave it to event handler containers to reference such event handlers weakly. This has very simple and direct usage, but also its own problems. We can discuss it further if you find this solution preferred to the wrapper approach.
>
> Extending WeakReference and lacking the public constructor did make me a little weak in the knees :-). What were the problems with WeakEventHandler being an interface?
>
> Thanks!
> Richard



-- 
Sven Reimers

* Senior Expert Software Architect
* NetBeans Dream Team Member: http://dreamteam.netbeans.org
* NetBeans Governance Board Member: http://netbeans.org/about/os/governance.html
* Community Leader  NetBeans: http://community.java.net/netbeans
                              Desktop Java:
http://community.java.net/javadesktop
* Duke's Choice Award Winner 2009
* Blog: http://nbguru.blogspot.com

* XING: https://www.xing.com/profile/Sven_Reimers8
* LinkedIn: http://www.linkedin.com/in/svenreimers

Join the NetBeans Groups:
* XING: http://www.xing.com/group-20148.82db20
* NUGM: http://haug-server.dyndns.org/display/NUGM/Home
* LinkedIn: http://www.linkedin.com/groups?gid=1860468
                   http://www.linkedin.com/groups?gid=107402
                   http://www.linkedin.com/groups?gid=1684717
* Oracle: https://mix.oracle.com/groups/18497


More information about the openjfx-dev mailing list