22 August 2005

Comments on Nulls : Nothing to worry about by Phil Zoio as published in Oracle mag (link to global post)
First you should ask what it means from a business point of view to have a null ! Information missing ? not applicable ?
Then COALESCE, IS NULL, IS NOT NULL are the most obvious functions to avoid problems.
Would you feel safe by using only “NOT NULL” fields in your tables ? No : an outer join will bring them back easily.
In scalar expression : SAL+NULL results in NULL, but in boolean expression : SAL (SELECT MAX(SAL) FROM A) and WHERE SAL > ALL (SELECT SAL FROM A) if A is empty, the first query returns nothing (UNKNOWN) but the second will always be TRUE, because SAL > ALL (NULL) is always true.
Is SUM(SAL+COMM) the same as SUM(SAL)+SUM(COMM) ?? No : Nulls are ignored by aggregates functions !
More tricky : WHERE EMPNO IN (SELECT MGR FROM A) if a MGR is NULL : what do you expect ? Nothing : since EMPNO IN (…, NULL, …) is UNKNOWN or FALSE, the query returns nothing.
Conclusion : there are more than one way to write a query : choose the right one …

To Layer, or not to Layer? That is the Architectural Question

20 August 2005

Comments on a short article : To Layer, or not to Layer? That is the Architectural Question by Kevin Hooke. Debate follow on The Server Side.
Basically : The question is not if layers bring too much code than it is worth, but rather how to avoid the plumbing code through templating, frameworks (Spring, EJB3, ejbdoclets …) or IDE.
It is worth to recall this :

Before starting to develop an application with the java platform ask the good questions:
Do I need to distribute?
Do I need to support transaction?
And then choose the right technologies and architecture and layers
Java is not equal to J2EE
J2EE is not equal to EJB

And I found a reference to Martin Fowler‘s “Patterns of Enterprise Application Architecture” book (2002). But from the comments on Amazon, I won’t buy this book. Instead, I will make an other post about finding a good Architecture book … and still subscribe to Fowler’s blog.

Test Framework Comparison

20 August 2005

Comments on Test Framework Comparison by Justin Lee in The Server Side.
JUnit has competitors but with version 4, it should stay as the most used and the one to know. There are more and more integration with IDE. It will use annotations, group of tests, no need to subclass, dependent methods, exceptions, timeout
Still, depending on the project, JUnit may not always be the best choice and its competitors are easy (10 minutes) to learn. TestNG seems the one with the most advanced features (methods can take parameter, logging, reporting …) and JTiger the simpliest to use (NUnit is cited too, but not covered.)
The article lacks information about IDE integration and integration is possible with continuous integration frameworks.

Hierarchy Versus Facets Versus Tags

20 August 2005

From The problem of where to file: Is it possible to construct the perfect classification system? by Mimi Yin.
He gives some examples and show the pro and cons of the 3 systems. It is more objectiv than the previous article I reported : Ontology is overrated: categories, links, and tags.
Form : 16 pages with graphics.
Source : InfoDesign: Understanding by Design.

Best practices for testing J2EE database applications

18 August 2005

Comments on Testing 1, 2, 3 . . . by Phil Zoio as published in Oracle mag (link to global post)
He tests the layer of the J2EE application reponsible for persistent access and manipulation. This layer is usually encapsulated in a DAO. The practices ranges from practical ones, such as externalise assertion data, create a dedicated test library … to more subjectiv like write comprehensive tests, use precise assertions …
It is not an easy subject and there are few experienced authors.

Oracle Magazine July/August 2005

14 August 2005

I just finished Oracle Magazine July/August 2005. For thoses who doesn’t know it is a nice paper magazine freely available !
I will certainly make distinct posts about some articles :

Yet another Java Web framework : Wicket

14 August 2005

Wicket :

Wicket is a Java web application framework that takes simplicity, separation of concerns and ease of development to a whole new level. Wicket pages can be mocked up, previewed and later revised using standard WYSIWYG HTML design tools. Dynamic content processing and form handling is all handled in Java code using a first-class component model backed by POJO data beans that can easily be persisted using your favourite technology.

Designing and implementing any framework for use in the real world inevitably involves compromises and some degree of complexity, and Wicket is no exception. However, I believe you will find that Wicket is quite compact, focused and powerful as a framework. If Wicket has these characteristics, it is because it was designed to solve one very specific problem well:
enabling component-oriented, programmatic manipulation of markup
Wicket does this and very little else, and that is a good thing.

Still, Struts will stay the de facto standard for some more years …