Open Source Java Directory
Submitted by david on Thu, 31/05/2007 - 19:17.I suspect I might be the last one to find this, and I haven’t yet checked enough of the entries to know how up-to-date they are, but this is a pretty lengthy listing of Java OSS software.
Design Patterns are 'Code Smells'
Submitted by david on Mon, 21/05/2007 - 19:37.Stuart Halloway has an article in his blog on Relevance LLC entitled Design Patterns are Code Smells.
Am I missing something or is this stating the downright obvious? A Design Pattern is a commonly used solution to a design problem in that particular context, i.e. using that particular language. Taking that solution out of its original context (by moving it to another language, say) means that it needs a complete re-evaluation of both the nature of the problem and the solution itself.
I think Stuart misunderstands ‘Design Patterns’ as ‘Code Patterns’ - they are not. They are design solutions where, for convenience, code examples are given. Of course that means that, for the purposes of code reviews, each team needs to formulate its own set of acceptable code templates, adapting each pattern to the language and framework being used.
Three-Phase Validation Pattern
Submitted by david on Sat, 19/05/2007 - 12:57.This is a pattern that I have developed for handling validation in web and J2EE applications. It relies on the idea that most systems of this type use a tiered approach to data processing, and approaches the problem of how to validate sets of data strings submitted over the web. The solution I have evolved involves a ‘Three-Phase Validation’ pattern which breaks the validation processing into the three main ways that data can fail validation.
By using a chain-of-responsibility type pattern validation failures can be handled consistently, while distributing responsibility for validation across three sets of components lying often in different logical tiers of the system. This allows each component to validate the elements that are relevant to its role, and so avoids the need to break encapsulation by forcing all the validation to be done at the Web Application level.
DeveloperWorks article on Java Compilation Techniques
Submitted by david on Thu, 17/05/2007 - 09:09.When Java was initially introduced, performance - more specifically Java’s limited performance - was rightly one of the main criticisms of the platform.
However it surprises me when I talk to developers nowadays who still confidently assert that Java is slower than equivalent languages because it is not compiled directly to an executable. That assertion shows little or no understanding of the decisions that compilers have to make, and the performance losses that can happen when the compilers ‘guess’ wrongly how the program is going to behave in real use.
This article examines the strengths and weaknesses of Ahead-Of-Time (traditional executable compilation) and the Just-In-Time approach used by many JVMs.
Article on HTML Templating Engine Design
Submitted by david on Tue, 15/05/2007 - 09:17.Daniel Martin (writing on Live Journal) has an interesting article on the right and wrong ways to do HTML expression languages and expression markup for the security conscious. Specifically, the right way to write expressions if you want to avoid Cross-Site Scripting (XSS) exploits.
Although the article is targetted at the writers of HTML templating engines, it is also of use to those of you coding JSP/ASP/PHP pages.
Subversion: Cannot replace a directory from within
Submitted by david on Tue, 06/03/2007 - 14:23.While trying to perform a command-line merge with subversion recently, I encountered one of the best indecipherable errors that I have seen for a while:
subversion/libsvn_ra_dav/util.c:826: (apr_err=160005)
svn: REPORT request failed on '/svn/eta/!svn/vcc/default'
subversion/libsvn_ra_dav/util.c:389: (apr_err=160005)
svn: Cannot replace a directory from within
Turns out that if you see that error, you should replace all the ‘:’ characters in your subversion command with ‘@’ ones and all will be well…
Tabbed Page Module for Drupal 5
Submitted by david on Sun, 04/03/2007 - 22:13.I have updated the Tabbed Paged module for Drupal 5, and it can be downloaded from this page.
I am also pretty certain that I have reproduced and fixed the problem with the ‘Group Under’ ID defaulting to 0.
There seems to have been enough interest in the module to justify adding it as a project on Drupal.org, so I will upload it in the next few days.
Performance Comparison of DHTML content creation approaches
Submitted by david on Sat, 03/03/2007 - 19:08.This is a very revealing article from the excellent QuirksMode website (and, if you don’t know what Quirks Mode is, you should find out - it’s one of my favourite interview questions!).
It contains the results of performance analysis comparing W3C DOM manipulation methods with InnerHTML calls for creating large amounts of dynamic content, including information for three versions of Internet Explorer, Mozilla, Opera and Safari.
JsonML
Submitted by david on Sat, 03/03/2007 - 18:48.An interesting twist on the Ajax game, JSON is normally used to send to JavaScript data across to the browser, but this library adapts the idea to encode structural DOM data in JSON syntax.
Likely not to be hugely performant, but a fascinating example of what is possible in the AJAX arena.
Comments Re-Enabled
Submitted by david on Fri, 02/03/2007 - 09:16.Now that this site has been upgraded to Drupal 5, I have added the Spam module to try to deal with the large amounts of comment spam that I was receiving before I disabled comments.
This has allowed me to re-enable the posting of comments on the site. Additionally it now allows you to report spam comments when you spot them - please do so.
On another note, my apologies for the lack of recent updates. It is not from the lack of things to write about, in fact the complete opposite, so I hope to be posting quite a few articles in the near future catching up on some of the things that I’ve been looking at.

