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


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

Re: Swing is dead! Long live Swing.

From Lew <noone@lewscanon.com>
Newsgroups comp.lang.java.programmer
Subject Re: Swing is dead! Long live Swing.
Date 2012-02-26 13:16 -0800
Organization albasani.net
Message-ID <jie7f0$64h$1@news.albasani.net> (permalink)
References (2 earlier) <jhk4nl$h4e$1@dont-email.me> <4f3d96c1$0$293$14726298@news.sunsite.dk> <MPG.29acbd14a4041de9896f2@202.177.16.121> <6f72r.16359$L12.15612@newsfe23.iad> <MPG.29b489064e43ada39896f5@202.177.16.121>

Show all headers | View raw


Wanja Gayk wrote:
> asandstrom3minus1 says...
>
>> Similarly, if an IDE chooses to make appropriate linkages between a GUI
>> description language like FXML or XAML, and code-behind, then you've got
>> that extra checking, and you can have code completion. There is no
>> reason in principle why an IDE could not support both for FXML
>> expression bindings or controller method event handlers, for example.
>>
>> A compiler is only one tool. You can't expect it to take care of
>> everything for you.
>
> Of course not, but in this case you've got the choice between letting
> the compiler (or let's say the IDE's background compilation) take care
> of something or not.
> I've been frequently annoyed by tools that do their binding by matching
> Strings to classes or component names, because every time you move,
> refactor or mistype something you're bound to get screwed. And it likes
> to happen in the worst possible moments. I'd rather avoid it, if I have
> the choice.

+1

Why use string-based binding like that in Java, among whose main strengths is 
rigorous type safety?

Sometimes in frameworks you'll do that, e.g., name an implementing class in a 
properties or XML configuration file, but the cost is always deferral of 
less-expensive compile-time safety to later, more costly run-time type 
failures. The benefit had better be worth it, and also worth the fragmentation 
of logic across more source artifacts.

I've seen the sacrifice made in code, too. That's just an execration. One 
egregious example I saw used reflection and casting to obtain a no-argument 
constructor based on matching class names to certain other class names, but 
still requiring casting through those same types. They sacrificed type safety, 
performance, simplicity and good sense to create a "factory" that had none of 
the benefits of an actual factory.

Prefer compile-time type assertions to run-time matchups.

-- 
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg

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


Thread

Swing is dead!  Long live Swing. Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2012-02-15 19:25 -0800
  Re: Swing is dead!  Long live Swing. Roedy Green <see_website@mindprod.com.invalid> - 2012-02-15 20:13 -0800
    Re: Swing is dead!  Long live Swing. Arne Vajhøj <arne@vajhoej.dk> - 2012-02-16 18:33 -0500
  Re: Swing is dead!  Long live Swing. Novice <novice@example..com> - 2012-02-16 19:13 +0000
    Re: Swing is dead!  Long live Swing. Arne Vajhøj <arne@vajhoej.dk> - 2012-02-16 18:32 -0500
      Re: Swing is dead!  Long live Swing. Novice <novice@example..com> - 2012-02-17 16:35 +0000
        Re: Swing is dead!  Long live Swing. Arne Vajhøj <arne@vajhoej.dk> - 2012-02-17 18:00 -0500
          Re: Swing is dead!  Long live Swing. Arne Vajhøj <arne@vajhoej.dk> - 2012-02-27 21:05 -0500
  Re: Swing is dead!  Long live Swing. Arne Vajhøj <arne@vajhoej.dk> - 2012-02-16 18:29 -0500
    Re: Swing is dead!  Long live Swing. Knute Johnson <nospam@knutejohnson.com> - 2012-02-16 15:50 -0800
      Re: Swing is dead!  Long live Swing. Arne Vajhøj <arne@vajhoej.dk> - 2012-02-16 18:52 -0500
        Re: Swing is dead!  Long live Swing. Knute Johnson <nospam@knutejohnson.com> - 2012-02-16 16:01 -0800
          Re: Swing is dead!  Long live Swing. Arne Vajhøj <arne@vajhoej.dk> - 2012-02-16 19:07 -0500
        Re: Swing is dead!  Long live Swing. Wanja Gayk <brixomatic@yahoo.com> - 2012-02-20 20:27 +0100
          Re: Swing is dead!  Long live Swing. Arne Vajhøj <arne@vajhoej.dk> - 2012-02-20 18:39 -0500
            Re: Swing is dead!  Long live Swing. Wanja Gayk <brixomatic@yahoo.com> - 2012-02-21 02:09 +0100
              Re: Swing is dead!  Long live Swing. Arne Vajhøj <arne@vajhoej.dk> - 2012-02-20 20:28 -0500
                Re: Swing is dead!  Long live Swing. Arne Vajhøj <arne@vajhoej.dk> - 2012-02-20 20:29 -0500
          Re: Swing is dead!  Long live Swing. Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-02-25 11:37 -0400
            Re: Swing is dead!  Long live Swing. Arne Vajhøj <arne@vajhoej.dk> - 2012-02-25 10:58 -0500
            Re: Swing is dead!  Long live Swing. Wanja Gayk <brixomatic@yahoo.com> - 2012-02-26 18:24 +0100
              Re: Swing is dead!  Long live Swing. markspace <-@.> - 2012-02-26 10:27 -0800
                Re: Swing is dead!  Long live Swing. Lew <noone@lewscanon.com> - 2012-02-26 13:16 -0800
                Re: Swing is dead!  Long live Swing. Arne Vajhøj <arne@vajhoej.dk> - 2012-02-26 18:05 -0500
                Re: Swing is dead!  Long live Swing. Wanja Gayk <brixomatic@yahoo.com> - 2012-02-28 23:19 +0100
                Re: Swing is dead!  Long live Swing. Lew <noone@lewscanon.com> - 2012-02-29 00:00 -0800
                Re: Swing is dead!  Long live Swing. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-02-29 09:10 -0800
                Re: Swing is dead!  Long live Swing. Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-02-29 05:53 -0400
                Re: Swing is dead!  Long live Swing. Wanja Gayk <brixomatic@yahoo.com> - 2012-02-29 11:11 +0100
              Re: Swing is dead!  Long live Swing. Lew <noone@lewscanon.com> - 2012-02-26 13:16 -0800
                Re: Swing is dead!  Long live Swing. Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-02-26 19:32 -0400
                Re: Swing is dead!  Long live Swing. Lew <noone@lewscanon.com> - 2012-02-26 16:59 -0800
                Re: Swing is dead!  Long live Swing. Arne Vajhøj <arne@vajhoej.dk> - 2012-02-26 21:03 -0500
                Re: Swing is dead!  Long live Swing. Lew <noone@lewscanon.com> - 2012-02-26 21:22 -0800
                Re: Swing is dead!  Long live Swing. Arne Vajhøj <arne@vajhoej.dk> - 2012-02-27 21:00 -0500
                Re: Swing is dead!  Long live Swing. Wanja Gayk <brixomatic@yahoo.com> - 2012-02-28 23:34 +0100
  Re: Swing is dead!  Long live Swing. markspace <-@.> - 2012-02-16 16:43 -0800
  Re: Swing is dead!  Long live Swing. Roedy Green <see_website@mindprod.com.invalid> - 2012-02-17 09:24 -0800
    Re: Swing is dead!  Long live Swing. Arne Vajhøj <arne@vajhoej.dk> - 2012-02-17 17:52 -0500

csiph-web