Pages

Wednesday, August 31, 2005

More Facelets observations

Development of my first JSF/Facelets application is going along smoothly. I really, REALLY like Facelets. It makes JSF web programming very easy. The templating features, when compared to using Tiles with JSF, are great. The error messages support is very well thought out. I'm going to add in some AJAX stuff (using DWR) and other eye candy features (OpenRico, etc. ). Having tons of fun.

Sunday, August 28, 2005

Facelet observations, day 1

Here are my initial observations of Facelets:
  • Error message are much better reported through Facelets than without. Jacob has scratched an itch many of us in the Java EE community have had for a very long, long time. Thank you for informative error message pages. Much appreciated.
  • Very quick. JSF overall seems very spunky, compared to Struts. Just unquantified observations at this point, but it does seem quick.
  • I like that I don't have to define everything in JSF XML markup. That's a tough sell to most dev. shops. XHTML is the way to go.
I have FORM-based authentication finally working within my example application. Nothing special, but I was have some difficulties with this and I think I have those issues resolved.

Saturday, August 27, 2005

Starting to use Facelets

In my endeavor to learn the JSF thing, I've started playing around with Facelets. So far so good. I've integrated into my existing MyFaces project. I did have some initial problems with the Facelets JARs to add to the project. I ended up only using jsf-facelets.jar, el-api.jar, and el-ri.jar. Seems really easy to use and I really like the templating support in Facelets; it's a definite improvement over Tiles.

Tuesday, August 16, 2005

Using the type-safe enumeration pattern in Java

I just completed some programming duties, pairing with another developer at my day job. We needed to add some new attributes to an address, specifically an address type and a foreign address indication. Instead of making these String types, we used Josh Bloch's type-safe enum pattern and narrowed the interface contract to AddressType and ForeignAddressIndicator types. Worked out great. I've seen a lot of Java source lately that just passes ints and Strings and does nothing to validate that the values are correct for the usage. This pattern works well for this validity checking, limiting the possible values and allowing the compiler to enforce type safety.