Archive for the ‘java’ Category
Monday, April 9th, 2007
Having recently been severely frustrated by that other ambitious Apache project that aims at “making the build process easy”, and “providing guidelines for best practices development”, etc. - OK, who am I kidding? Yes, I’m referring to maven 2.
- I turned my eyes to Ivy, and, after a couple of week of using it, found myself comfortable enough to write this to recommend Ivy as an indispensable part in any serious Ant-based build tools arsenal. more…
Posted in java | 1 Comment »
Wednesday, February 28th, 2007
YUI has been my favorite AJAX library for two reasons: its unintrusiveness to the server side, and the excellent documentation. It is interesting and encouraging to see Yahoo offer free hosting for YUI. While there are obviously valid reasons for some sites not to use this service (external dependency etc.), the power of yahoo’s server facility, the advanced cache control, and the on-the-fly file size reduction (up to 90% according to the announcement linked) are in no doubt going to be very appealing to many others. more…
Posted in java, web-design | No Comments »
Tuesday, February 27th, 2007
I just wanted to expand on Richard Relos’s we don’t really need closures in Java into a broader argument - syntax sugar is the least of what Java really needs now. more…
Posted in java | 6 Comments »
Monday, February 26th, 2007
I have been interviewing a number of folks to help filling up some Java developer positions. More than one of them (mind you, referred through different sources) told me, as part of the answer to “how would you implement a singleton?”, that I must override clone() to make sure my previous singleton wouldn’t get, well, cloned. And they all told me that they learned it “somewhere,” only unsure where that “somewhere” was.
I did some googling and actually found a couple of “Java tutorial” sites that tell people to override clone() as part of a “standard” singleton implementation. I won’t be linking to any of those sites for the obvious reason of not wanting to bump up their google rankings. And I’m just gonna post some kind of “counter-jinx” here:
If you are preparing for an interview, and happen to stumble upon this blog, please, please remember that Object.clone() by default throws CloneNotSupportException if the class does not implement Cloneable, and I don’t really think you would want to tell your interviewer that you wish to have your singleton class implementing Cloneable. So, no, it’s completely unnecessary to override the clone() method in a singleton implementation.
Posted in java | 3 Comments »
Sunday, January 14th, 2007
The new BeanDefinitionBuilder class added in Spring 2.0 allows an XML-less way to build application contexts programmatically. Can be very useful for, say, creating quick testing setups in one of those script languages. more…
Posted in java, spring | 8 Comments »
Saturday, January 6th, 2007
The standard Ubuntu repository has only 1.3.2. Higepon’s tips worked very well. In addition to the packages listed, I had to also install ‘expat-dev’.
Posted in LAMP, Ubuntu, java | 1 Comment »
Tuesday, December 12th, 2006
(Traceback to Weiqi Gao’s post)
Considering “.” is used as the accessor universally for all properties and methods in C#, as well as most script languages Java 6 has just made easier supporting, I for one would be very interested in learning the rationale behind using -> for property access - it’s got to be a conscious decision.
Another thing that had some coffee-spilling effect on me was the “Closures, Lambdas and friends” part. On the first look, I thought they were adding “friend” support in Java 7 (as in C++), which would have been a good thing. 
Posted in java | No Comments »
Wednesday, October 11th, 2006
IMHO, Concise Instance Creation Expression, the Lee-Lea-Block Proposal for Closures in Java, carries a more hefty price tag than it seems: more…
Posted in java | 7 Comments »
Monday, October 9th, 2006
Most of the time, we configure the controllers in our Spring MVC application to be singletons, because of the their stateless nature. However, being configured as normal Spring beans, Spring controllers can also be declared with the prototype scope. more…
Posted in java, spring | 2 Comments »
Thursday, September 14th, 2006
OK, I know this sounds like another one of those “a white horse is not a horse” arguments, but from my observation on the Spring forums and other blog reading, some clear distinction between the semantics of a Spring singleton and a classical Java singleton has become much necessary. The overloaded term has caused quite some confusion, especially for someone who has just started picking up Spring. more…
Posted in java, spring | 4 Comments »