
August 24th, 2008 by

Lincoln Baxter III
A4J:Form is missing several specified ajax functions
(
View this issue on the JBoss tracker here. Keep reading, there is a fix… download fix)
The issue:
When using the a4j:form component, the
data=”#{managedBean.property}” the properties defined in the
data element list are supposed to be available after the a4j event in the
data JavaScript variable; however, with <a4j:form> the attribute is not correctly causing the JavaScript
data variable to be populated.

August 17th, 2008 by

Lincoln Baxter III
Tutorial Chapter 2 – Easier Development and Maintenance
Tired of wiring in an
id,
version, and
timestamp field into all of your Hibernate objects? There’s an easy way to solve this pain once and for all of your classes. Avoid code-repetition: today’s article focuses on using Hibernate Annotations to map common fields into one mapped superclass.
If you have not done so already, and need to get a bare bones hibernate application up and running,
this guide should get you up and running in a few minutes.

August 1st, 2008 by

Lincoln Baxter III
Today’s subject is a well commented square root approximation method. Imagine that this method is buried deep in a very messy Java class. How can we make sure that this code is reusable and that our comments don’t become out of date as our code changes?
/**
* Approximate the square root of n, to within the specified tolerance,
* using the Newton-Raphson method. This method takes two arguments:
* @param Double n The number to be square-rooted
* @param Double tolerance the error tolerance
* @return Double result of square root operation
*/
public Double approximateSquareRoot(Double n, Double tolerance)
{
Double root = n / 2;
while (Math.abs(root - (n / root)) > tolerance)
{
root = 0.5 * (root + (n / root));
}
return root;
} |
/**
* Approximate the square root of n, to within the specified tolerance,
* using the Newton-Raphson method. This method takes two arguments:
* @param Double n The number to be square-rooted
* @param Double tolerance the error tolerance
* @return Double result of square root operation
*/
public Double approximateSquareRoot(Double n, Double tolerance)
{
Double root = n / 2;
while (Math.abs(root - (n / root)) > tolerance)
{
root = 0.5 * (root + (n / root));
}
return root;
}

July 22nd, 2008 by

Lincoln Baxter III
Is there light at the end of the tunnel?
So I’m sure I’m not alone here, when I say that Hibernate can be frustrating, difficult to learn, and may even feel like to use it means to give up on some design principles that have been proven by many.
When you first begin, it feels like there are holes, inconsistencies, and problems that send you running home to the familiar behavior of plain SQL. But, I don’t think it’s time to give up on Hibernate yet.
Keep in mind that I am a relatively new Hibernate user, I consider myself somewhat experienced with software development, design patterns, principles, and best practices. If this sounds like you, read on…