Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #32497

Re: Self-updating relationship

Path csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From James Kuyper <jameskuyper@verizon.net>
Newsgroups comp.lang.c, comp.lang.java.programmer
Subject Re: Self-updating relationship
Date Thu, 3 Sep 2015 12:16:48 -0400
Organization A noiseless patient Spider
Lines 64
Message-ID <ms9rm4$ki2$1@dont-email.me> (permalink)
References <relationship-20150902211808@ram.dialup.fu-berlin.de> <55E766BD.3060303@verizon.net> <spaces-20150902222406@ram.dialup.fu-berlin.de> <55E77D04.6080200@verizon.net> <properties-20150903001216@ram.dialup.fu-berlin.de> <55E78636.5000908@verizon.net> <ms8g5j$o5k$1@dont-email.me> <ms9llv$pto$1@dont-email.me> <ms9mpb$srk$1@dont-email.me> <ms9p30$8vc$1@dont-email.me>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 7bit
Injection-Date Thu, 3 Sep 2015 16:15:01 +0000 (UTC)
Injection-Info mx02.eternal-september.org; posting-host="237340c5d7daa6a73649b97706dc7bac"; logging-data="21058"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18m9uqGzZ7WHGkLDL0AqZU472uX8rq6WK0="
User-Agent Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.2.0
In-Reply-To <ms9p30$8vc$1@dont-email.me>
Cancel-Lock sha1:n58G0pwBVZC79U6xdcNAgt1CKgA=
Xref csiph.com comp.lang.c:69156 comp.lang.java.programmer:32497

Cross-posted to 2 groups.

Show key headers only | View raw


On 09/03/2015 11:31 AM, Jeff Higgins wrote:
> On 09/03/2015 10:53 AM, James Kuyper wrote:
>> On 09/03/2015 10:32 AM, Jeff Higgins wrote:
>>> On 09/02/2015 11:52 PM, Jeff Higgins wrote:
>>>> On 09/02/2015 07:28 PM, James Kuyper wrote:
>>>
>>>>> Your earlier version had:
>>>>>>       final javafx.beans.binding.NumberBinding spaces =
>>>>>>       height.subtract( number );
>>>>>
>>>>> which causes spaces.getValue() to behave like the equivalent of a C++
>>>>> member function whose return value is calculated using the specified
>>>>> formula freshly each time "spaces" is referred to. Is this a
>>>>> characteristic of binding.NumberBinding, or some more general Java
>>>>> feature?
>>>>
>>>> It's a characteristic of the
>>>> javafx.beans.binding.Binding<T> interface.
>>>> <https://docs.oracle.com/javase/8/javafx/api/javafx/beans/binding/Binding.html>
>>>>
>>>
>>> Sorry, this is incorrect.
>>> It's a characteristic of the
>>> javafx.beans.property.Property<T> interface.
>>> <https://docs.oracle.com/javase/8/javafx/api/javafx/beans/property/Property.html>
>>
>> According to Stefan Ram, using the following code:
>>>      final javafx.beans.binding.NumberBinding spaces =
>>>      height.subtract( number );
>>
>> would cause the subtraction to be re-evaluated with the current values
>> of height and number, each time spaces.getValue() is called, while
> 
> Correct.
> 
>>
>>
>>>      final javafx.beans.property.IntegerProperty spaces
>>>      = new javafx.beans.property.SimpleIntegerProperty
>>>      ( height.getValue() - number.getValue() );
>>
>> would cause the subtraction to be performed only once, when spaces is
>> created. Are you saying he got those reversed?
> 
> No.

OK - I thought I was beginning to understand  what was going on, but now
I'm thoroughly confused. You're saying that this behavior (Specifically,
the behavior of re-calculating the subtraction each time
spaces.getValue() is used) is a property of the
javafx.beans.property.Property<T> interface, rather than a property of
the javafx.beans.binding.Binding<T> interface, despite the fact that it
happens when he uses javafx.beans.binding.NumberBinding, and doesn't
happen when he uses javafx.beans.property.SimpleIntegerProperty?

How does that work? Does javafx.beans.binding.NumberBinding use
javafx.beans.property.Property<T> while
javafx.beans.property.SimpleIntegerProperty uses
javafx.beans.binding.Binding<T>? That's not at all what I would have
expected, based solely upon the names.


-- 
James Kuyper

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Self-updating relationship James Kuyper <jameskuyper@verizon.net> - 2015-09-02 17:14 -0400
  Re: Self-updating relationship Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-09-02 17:46 -0400
    Re: Self-updating relationship Arne Vajhøj <arne@vajhoej.dk> - 2015-09-03 21:06 -0400
      Re: Self-updating relationship e.d.programmer@gmail.com - 2015-09-04 04:46 -0700
        Re: Self-updating relationship Arne Vajhøj <arne@vajhoej.dk> - 2015-09-04 19:43 -0400
    Re: Self-updating relationship Jeff Higgins <jeff@invalid.invalid> - 2015-09-04 11:49 -0400
      Re: Self-updating relationship Arne Vajhøj <arne@vajhoej.dk> - 2015-09-04 19:45 -0400
        Re: Self-updating relationship Jeff Higgins <jeff@invalid.invalid> - 2015-09-04 22:10 -0400
          Re: Self-updating relationship Arne Vajhøj <arne@vajhoej.dk> - 2015-09-04 22:31 -0400
            Re: Self-updating relationship Arne Vajhøj <arne@vajhoej.dk> - 2015-09-04 22:38 -0400
            Re: Self-updating relationship Jeff Higgins <jeff@invalid.invalid> - 2015-09-04 22:51 -0400
  Re: Self-updating relationship James Kuyper <jameskuyper@verizon.net> - 2015-09-02 18:49 -0400
    Re: Self-updating relationship James Kuyper <jameskuyper@verizon.net> - 2015-09-02 19:28 -0400
      Re: Self-updating relationship Jeff Higgins <jeff@invalid.invalid> - 2015-09-02 23:52 -0400
        Re: Self-updating relationship Jeff Higgins <jeff@invalid.invalid> - 2015-09-03 10:32 -0400
          Re: Self-updating relationship James Kuyper <jameskuyper@verizon.net> - 2015-09-03 10:53 -0400
            Re: Self-updating relationship Jeff Higgins <jeff@invalid.invalid> - 2015-09-03 11:31 -0400
              Re: Self-updating relationship Jeff Higgins <jeff@invalid.invalid> - 2015-09-03 11:35 -0400
              Re: Self-updating relationship Jeff Higgins <jeff@invalid.invalid> - 2015-09-03 11:49 -0400
              Re: Self-updating relationship James Kuyper <jameskuyper@verizon.net> - 2015-09-03 12:16 -0400
                Re: Self-updating relationship Jeff Higgins <jeff@invalid.invalid> - 2015-09-03 13:03 -0400
          Re: Self-updating relationship Jeff Higgins <jeff@invalid.invalid> - 2015-09-03 10:55 -0400
      Re: Self-updating relationship James Kuyper <jameskuyper@verizon.net> - 2015-09-03 00:06 -0400
    Re: Self-updating relationship Jeff Higgins <jeff@invalid.invalid> - 2015-09-02 23:38 -0400
      Re: Self-updating relationship Jeff Higgins <jeff@invalid.invalid> - 2015-09-03 01:22 -0400

csiph-web