RE: Move to JIRA [was: Re: [8u] API Request: RT-25613, ObservableValue should have a hasListener(listener) method]

2014-01-26 Thread Seeon Birger
: Anthony Petrov Sent: Friday, January 24, 2014 1:07 PM To: Seeon Birger; Steve Northover Cc: John Hendrikx; openjfx-dev@openjdk.java.net Subject: Re: Move to JIRA [was: Re: [8u] API Request: RT-25613, ObservableValue should have a hasListener(listener) method] Hi Seeon, I don't think that posting

RE: Move to JIRA [was: Re: [8u] API Request: RT-25613, ObservableValue should have a hasListener(listener) method]

2014-01-23 Thread Seeon Birger
; openjfx-dev@openjdk.java.net Subject: Re: Move to JIRA [was: Re: [8u] API Request: RT-25613, ObservableValue should have a hasListener(listener) method] Hi John, The goal is not to end the discussion! It's a trade off. Mailing lists are good because they provide a threaded discussion. JIRA

Re: [8u] API Request: RT-25613, ObservableValue should have a hasListener(listener) method

2014-01-22 Thread Randahl Fink Isaksen
Hi Martin While I agree your proposed solution would work, I still don’t understand why JavaFX should keep on supporting duplicates in listener collections. Can anyone come up with just 1 example of an application that might be depending on having two listeners on the same Observable? E.g.

Re: [8u] API Request: RT-25613, ObservableValue should have a hasListener(listener) method

2014-01-22 Thread Martin Sladecek
The reason why this was decided this way is simple : performance. You usually don't (try to) add a listener twice, so in most cases it doesn't make sense to check for duplicates every time a listener is added. So we currently leave the burden of avoiding duplicates on the developer. -Martin

Re: [8u] API Request: RT-25613, ObservableValue should have a hasListener(listener) method

2014-01-22 Thread Tom Schindl
On 22.01.14 11:07, Martin Sladecek wrote: Hi all, I would like to start discussion about an addition to API in Observable, ObservableValue and all Observable collections. There were multiple requests for a way how to avoid duplicates in listeners lists. The way RT-25613 solves this is that it

Re: [8u] API Request: RT-25613, ObservableValue should have a hasListener(listener) method

2014-01-22 Thread Randahl Fink Isaksen
Hi Martin Then I respectfully disagree with this design decision. In my point of view, choosing performance over ease of use is rarely a good idea. Here, the performance choice has put us in a situation where no one knows how many JavaFX apps have duplicate listener bugs, and such bugs can be

Re: [8u] API Request: RT-25613, ObservableValue should have a hasListener(listener) method

2014-01-22 Thread Martin Sladecek
On 01/22/2014 11:27 AM, Tom Schindl wrote: On 22.01.14 11:07, Martin Sladecek wrote: Hi all, I would like to start discussion about an addition to API in Observable, ObservableValue and all Observable collections. There were multiple requests for a way how to avoid duplicates in listeners

Re: [8u] API Request: RT-25613, ObservableValue should have a hasListener(listener) method

2014-01-22 Thread Martin Sladecek
On 01/22/2014 11:38 AM, Randahl Fink Isaksen wrote: Hi Martin Then I respectfully disagree with this design decision. In my point of view, choosing performance over ease of use is rarely a good idea. Here, the performance choice has put us in a situation where no one knows how many JavaFX

Re: [8u] API Request: RT-25613, ObservableValue should have a hasListener(listener) method

2014-01-22 Thread Richard Bair
The default implementation (for Observable) would look like this: public default void ensureListener(InvalidationListener listener) { removeListener(listener); addListener(listener); } subclasses might do something more effective. The same would apply to ObservableValue and

Re: [8u] API Request: RT-25613, ObservableValue should have a hasListener(listener) method

2014-01-22 Thread Randahl Fink Isaksen
I respect your point of view. Thank you for a thorough response. Randahl On 22 Jan 2014, at 12:18, Martin Sladecek martin.slade...@oracle.com wrote: On 01/22/2014 11:38 AM, Randahl Fink Isaksen wrote: Hi Martin Then I respectfully disagree with this design decision. In my point of view,

Re: [8u] API Request: RT-25613, ObservableValue should have a hasListener(listener) method

2014-01-22 Thread Tomas Mikula
On Wed, Jan 22, 2014 at 11:27 AM, Tom Schindl tom.schi...@bestsolution.atwrote: On 22.01.14 11:07, Martin Sladecek wrote: Hi all, I would like to start discussion about an addition to API in Observable, ObservableValue and all Observable collections. There were multiple requests for a

Re: [8u] API Request: RT-25613, ObservableValue should have a hasListener(listener) method

2014-01-22 Thread Tomas Mikula
Hi Randahl, I'm curious about an example where you would take advantage of the behavior where multiple addListener(listener) calls add the listener just once. Anyway, here [1] are helper classes InvalidationSubscriber and ChangeSubscriber that allow you to do that: InvalidationSubscriber

Re: [8u] API Request: RT-25613, ObservableValue should have a hasListener(listener) method

2014-01-22 Thread Martin Sladecek
On 01/22/2014 12:30 PM, Richard Bair wrote: The default implementation (for Observable) would look like this: public default void ensureListener(InvalidationListener listener) { removeListener(listener); addListener(listener); } subclasses might do something more effective. The same

Re: [8u] API Request: RT-25613, ObservableValue should have a hasListener(listener) method

2014-01-22 Thread Tom Schindl
[...] Actually even when you would rely on the order, in situations when you call ensureListener, you don't really know if the listener is already there. So you might really expect that listener would be added at this point as the last. It's just that will always be the outcome if the

Re: [8u] API Request: RT-25613, ObservableValue should have a hasListener(listener) method

2014-01-22 Thread Randahl Fink Isaksen
Hi Tomas Great idea! I can see how the InvalidationSubscriber idea would work – but it is just a concept right? There is no official API for this, right? Randahl On 22 Jan 2014, at 13:34, Tomas Mikula tomas.mik...@gmail.com wrote: Hi Randahl, I'm curious about an example where you

Re: [8u] API Request: RT-25613, ObservableValue should have a hasListener(listener) method

2014-01-22 Thread Ali Ebrahimi
I suggest adding another overload for addListener method taking boolean parameter duplicateAllowed or duplicateNotAllowed. On Wed, Jan 22, 2014 at 3:00 PM, Richard Bair richard.b...@oracle.comwrote: The default implementation (for Observable) would look like this: public default void

Move to JIRA [was: Re: [8u] API Request: RT-25613, ObservableValue should have a hasListener(listener) method]

2014-01-22 Thread Daniel Blaukopf
Hi Martin, Randahl, Tom, Richard, Tomas and Ali, This is a productive discussion, but once we get to this level of detail JIRA is the place to have it, so that we don’t lose our record of it. Would you continue the discussion on https://javafx-jira.kenai.com/browse/RT-25613 ? See

Re: Move to JIRA [was: Re: [8u] API Request: RT-25613, ObservableValue should have a hasListener(listener) method]

2014-01-22 Thread John Hendrikx
Unfortunately, discussing things in JIRA works very poorly and is a good way to end a productive discussion IMHO. Mailinglists are much better suited to the task, as thousands of interesting mailinglists accross many developer communities will atest to. Keeping a record is good, aren't these

Re: Move to JIRA [was: Re: [8u] API Request: RT-25613, ObservableValue should have a hasListener(listener) method]

2014-01-22 Thread Jonathan Giles
The point is that we'd rather have quick reference to the historical discussion without having to cross-reference between jira and the mailing list archives (which isn't automatically done). Once you add yourself as a watcher to the jira issue you are notified of every change, in much the same way

Re: Move to JIRA [was: Re: [8u] API Request: RT-25613, ObservableValue should have a hasListener(listener) method]

2014-01-22 Thread Stephen F Northover
Hi John, The goal is not to end the discussion! It's a trade off. Mailing lists are good because they provide a threaded discussion. JIRA is bad because it is not threaded. JIRA has the advantage that it captures data in a single place and provides a good history of why a decision was