Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.chainon-marquant.org!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!74.125.46.80.MISMATCH!postnews.google.com!news1.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe07.iad.POSTED!8ad76e89!not-for-mail From: Arved Sandstrom User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.27) Gecko/20120216 Lightning/1.0b2 Thunderbird/3.1.19 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: Swing is dead! Long live Swing. References: <4f3d9152$0$291$14726298@news.sunsite.dk> <4f3d96c1$0$293$14726298@news.sunsite.dk> <6f72r.16359$L12.15612@newsfe23.iad> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Lines: 51 Message-ID: X-Complaints-To: abuse@newsgroups-download.com NNTP-Posting-Date: Wed, 29 Feb 2012 09:53:37 UTC Organization: Public Usenet Newsgroup Access Date: Wed, 29 Feb 2012 05:53:36 -0400 X-Received-Bytes: 3138 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:12521 On 12-02-28 06:19 PM, Wanja Gayk wrote: > In article , -@. says... > >>> 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. > >> I tend to agree, strongly. For situations where I might be tempted to >> just use strings, I try to substitute enums. For example, instead of >> >> bind( someComponent, "event-name" ); >> >> I'd use this: >> >> bind( someComponent, Events.NAME ); >> >> It provides automatic syntax checking, and is much easier to refactor if >> names need to be changed or moved around later. >> >> Any thoughts on this idea? > > I think the same way. > I'm even going further and strongly propose preferring Enums to boolean > parameters and this is why: > http://brixomatic.wordpress.com/2010/02/24/boolean-harmful/ > > Kind regards, > Wanja > This little sub-thread I would have re-declared a few posts ago. You guys are advancing good ideas, but confusing the issue by making it sound like, in the context of the original discussion, that the end-user developer of FXML is going to be worried about these details when in fact he or she is not: it's the tools builder who is. That changes the discussion radically. Tools often use techniques and do things which sometimes cannot be recommended for the developer pool at large, because they are tricky and/or dangerous, and only above-average programmers ought to be doing things like that. I happen to agree in general that you use enums when you can. I don't see what these recommendations for Joe Average Coder have to do with a discussion of potential tool support for FXML. AHS -- -- Gaiety is the most outstanding feature of the Soviet Union. Josef Stalin, November 1935