Why I think CICE is too complex for the gain
Wednesday, October 11th, 2006IMHO, Concise Instance Creation Expression, the Lee-Lea-Block Proposal for Closures in Java, carries a more hefty price tag than it seems: more…
Jing Xue’s Weblog

IMHO, Concise Instance Creation Expression, the Lee-Lea-Block Proposal for Closures in Java, carries a more hefty price tag than it seems: more…
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…
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…
Fire up your favorite IDE, close all the files that are already open, and start implementing an individual feature of your project, just how you normally would go about it. Along the way, remember not to close any editor window (or tabs, or buffers, you got the idea) once it’s been opened. When you are done, count the Number of Open Files you have got so far – that’s the NoOF index for that particular feature. Repeat the process, and you have the average NoOF index of your project, which I think really tells something about the complexity of the framework/architecture your project employs. more…
We all know that this is bad:
But some of us (namely the dude who wrote the code that drove me crazy trying to troubleshoot today) apparently didn't know this was almost equally bad:
What's wrong with that is there is no way to tell at exactly which point DaoException was thrown, since the original stack traces are lost. So, my fellow Java programmers, please, please always do:
The only time should you be using the message-only constructor is when AppException is the root cause itself.
YUI Connection Manager throws this error when the ajax url passed to it is invalid (invalid as in, like, "I forgot to set the value!"). What makes it more obscure is it prints out the page url, which often looks alike, if not the same, the ajax url:
uncaught exception: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIXMLHttpRequest.open]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: http://localhost:8080/myapp/foo.do :: anonymous :: line 0" data: no]
Yeah, right, keep using String.split(",") to parse CSV files and one of these days you'll run into some comma hidden inside a pair of quotes - like how I did while trying to import some Excel-generated CSV file into a database. So I sat down and wrote this CSVParser with java.util.regex - it actually turned out to be a fun brain teaser to make a CSV parser that's able to parse any CSV files as defined by the Specification. To cope with the huge files I was importing, an additional requirement was to be able to parse in stream mode, instead of having to read the entire file into the memory first. That seemed to be easy at first but became quite a hassle because of the "a new line character can appear in a double-quoted field" part of the Spec.
This might sound philosophical and irrelevant, but hear me out - the biggest problem I have with checked exceptions is that they are way too prescriptive. When we say "checked exceptions force themselves to be handled," that's an understatement of the prescriptiveness. What's worse is actually that checked exceptions impose this forcement on the immediate caller. more...
So I am trying to use Hibernate to map a class hierarchy with table-per-hierarchy mixed with table-per-subclass. more...
One AJAX page I've been playing with has this UI flow that emulates a desktop form dialog - the user clicks on a link, a modal dialog shows up with a usual form, which the user fills out and submits to the server. Now, a successful response from the server can be one of these: if there are any form validation errors, the response is the same form annotated with the error message(s), in this case the response should be used to refresh the dialog. If there are no errors, the dialog is closed, and the response from the server should contain some content to update the area above the original link the user clicked on. more...