Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!goblin2!goblin.stu.neva.ru!newsgate.cuhk.edu.hk!news.netfront.net!not-for-mail From: Wanja Gayk Newsgroups: comp.lang.java.programmer Subject: Re: Swing is dead! Long live Swing. Date: Tue, 28 Feb 2012 23:34:36 +0100 Organization: Netfront http://www.netfront.net/ Lines: 37 Message-ID: References: <4f3d9152$0$291$14726298@news.sunsite.dk> <4f3d96c1$0$293$14726298@news.sunsite.dk> <6f72r.16359$L12.15612@newsfe23.iad> NNTP-Posting-Host: 93.130.23.26 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: adenine.netfront.net 1330468475 84076 93.130.23.26 (28 Feb 2012 22:34:35 GMT) X-Complaints-To: news@netfront.net NNTP-Posting-Date: Tue, 28 Feb 2012 22:34:35 +0000 (UTC) User-Agent: MicroPlanet-Gravity/3.0.4 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:12517 In article , noone@lewscanon.com says... > Why use string-based binding like that in Java, among whose main strengths is > rigorous type safety? That's what I've been asking myself over and over when dealing with the Reflection-API. I once found a more or less pleasing solution to the reflection-string-mess for me, assumed there is an interface: http://brixomatic.wordpress.com/2010/08/09/reflection-without-strings/ But of course that's just a workaround for not being able to reference a method directly, like: Method collectionSize = Collection#size(); int size = (int)collectionSize.invoke(someList); > 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. You're absolutely right. I have found that most of the times the benefit boils down to being able to change something while the program is running and I rarely come across a situation where this is really necessary. Kind regards, Wanja -- ..Alesi's problem was that the back of the car was jumping up and down dangerously - and I can assure you from having been teammate to Jean Alesi and knowing what kind of cars that he can pull up with, when Jean Alesi says that a car is dangerous - it is. [Jonathan Palmer] --- Posted via news://freenews.netfront.net/ - Complaints to news@netfront.net ---