Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #32483
| 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 00:06:09 -0400 |
| Organization | A noiseless patient Spider |
| Lines | 52 |
| Message-ID | <ms8gs4$pv1$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> <binding-20150903004309@ram.dialup.fu-berlin.de> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8 |
| Content-Transfer-Encoding | 8bit |
| Injection-Date | Thu, 3 Sep 2015 04:04:20 +0000 (UTC) |
| Injection-Info | mx02.eternal-september.org; posting-host="237340c5d7daa6a73649b97706dc7bac"; logging-data="26593"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19tOxzpz/Y/qrG1DXNEkDAy6ROC6LTqrRk=" |
| User-Agent | Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 |
| In-Reply-To | <binding-20150903004309@ram.dialup.fu-berlin.de> |
| Cancel-Lock | sha1:SjD5JmKB3Y6/KTi3nf/KHDq79oY= |
| Xref | csiph.com comp.lang.c:69052 comp.lang.java.programmer:32483 |
Cross-posted to 2 groups.
Show key headers only | View raw
On 09/02/2015 07:43 PM, Stefan Ram wrote:
> James Kuyper <jameskuyper@verizon.net> writes:
>> formula freshly each time "spaces" is referred to. Is this a
>> characteristic of binding.NumberBinding, or some more general Java feature?
>
> It is a characteristics of a certain standard Java library
> �JavaFX� that contains classes for "binding" properties to
> other properties. Binding can establish a spreadsheet-like
> relationship, so that one property can get updated when
> another property is updated. But this is a feature of the
> standard library, not of the language proper.
>
>> In C++, the equivalent of the first form above would be simpler than the
>> equivalent of the second form, so it feels odd that the second form is
>> simpler in Java. I'll try to keep that in mind should I ever need to
>> program in Java again. It sounds like I've got a lot to learn before I
>> even get started.
>
> I am not aware of a similar means of binding in the standard
> library of C++. But surely, one can implement it, if needed.
When I was talking about C++ equivalents, I was probably thinking of
something much simpler than what you're referring to as "binding". I
assumed that your original version worked something like the following:
struct Updating
{
int height;
int number;
Updating(int _height, int _number) : height(_height),
number(_number) {};
int spaces(void) const { return height - number; }
};
And what I was wondering about is which part of your code made it behave
that way, rather than the way this struct would:
struct OneTime
{
int height;
int number;
int spaces;
OneTime(int _height, int _number) : height(_height),
number(_number), spaces(_height - _number) {};
};
I'm not saying that OneTime is preferable to Updating, I was just
unclear about which features of your Java code caused it to behave more
like Updating than like OneTime. As I now understand it,
javafx.beans.binding.NumberBinding is that feature.
--
James Kuyper
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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