apache apachecon app asf atom atomprotocol atompub blogapps blogging businessblogging conferences family feeds foss general glassfish google humor ibm java javaone links linux mac microsoft movies music netbeans opensocial opensource photos politics rest roller rome rss socialnetworking socialsite socialsoftware sun triangle trianglebloggers vacation webdev webservices wiki
Andy Oliver is on a frightening roll with his latest rants. Looks like it all started after Andy spent some time playing with Mono, a GPL licensed implementation of Microsoft's C# language and Common Language Runtime. Since then Andy has said that Dot-Net is awesome, Sun doesn't have any balls, and the best way for a Java programmer to help Java is to learn Dot-Net. He has also suggested that Microsoft and Apache hook up because of their joint love of money and BSD. This guy is a dyed-in-the-wool Linux and Java nut. What the hell happened?
Maybe it did not start with Mono. Perhaps something happened at ApacheCon. You know, Comdex was also in town and Microsoft certainly had a presence there. You remember that Andy got very sick with some kind of stomach bug? I think some Rosemary's Baby-like incident occured out there and now Andy is carrying the spawn of Redmond in his belly. He's got the beast in his belly.Below is the email that I sent to the Hibernate and Castor mailing lists to ask for comments on Ag:
I've written a simple example application that shows how to create a simple web application (a newsfeed aggregator) with a pluggable persistence layer. I used the tried and true DAO pattern to hide the database access mechanism from the rest of the application. I implemented the DAO interface with both Hibernate and Castor.
I did this to learn:The code is very simple and (I hope) easy to follow, so if you have a chance please take a look. Look at the HibeAggregatorDAO and CastorAggregatorDAO implementations to see how I used Hiberate and Castor to implement the very same DAO. I'd love to get your opinions on the above topics.
Ag Download: http://sourceforge.net/project/shownotes.php?release_id=125110I decided that the only way to get a clue about pluggable persistence is to try and implement it, so that is what I did. I wrote a very simple JSP-based RSS aggregator with pluggable persistence via the DAO pattern. I implemented the persistence layer with both Hibernate and Castor and I used the RSS parser from Flock to parse RSS.
In the process I learned a lot about Hibernate and Castor. I am really impressed with Hibernate, but it is too late to go into any details. I do have time to say this: the Hibernate documentation is excellent, especially when you compare it to the incomplete hodge-podge of ad-hoc notes that comes with Castor. I did run into one snag that I have not yet worked around: Hibernate does not support CLOBs!
The aggregator is called, for lack of a better name, Ag. You can download Ag from SourceForge or just read the readme.txt.
Ag serves a number of purposes. I'll continue to experiment with Ag as I try to learn more about the advanced features of Hibernate and Castor. At some point, I'll probably merge Ag or some ideas from Ag into Roller. In the shorter term, I hope to use a portion of Ag as the example application for a chapter I'm writing on Data Access for WROX's new Professional JSP 2.0 book.
I do therefore invite my fellow-citizens in every part of the United States, and also those who are at sea and those who are sojourning in foreign lands, to set apart and observe the last Thursday of November next as a day of thanksgiving and praise to our beneficent Father [Abe Lincoln's Thanksgiving Proclaimation].
And don't forget to thank Mom too.
I've gotten a number of responses on my DAO post. Thanks to all who responded. I think the general consensus is that DAO is a useful pattern, but it can limit your ability to make use of all of the cool features of your persistence framework. I'll try to summarize the responses for you below:
Rickard Oberg says DAO is a useful pattern, but he has not tried to implement it a O/R framework before. Somewhat predicably, he adds that Aspect Oriented Programming (AOP) can play a role in improving DAO implementations.
Jason Carreirra says that the problem with DAO is that it requires fine grained objects, and that this makes it difficult to "streamline data access with bulk loading and caching."
Matt Raible says DAO works well, but does not like having to modify so many files just to add one field to an object. He'd like to automate the whole process with end-to-end code generation.
Russell Beattie reminds us of his complexity of J2EE post, but unlike Matt he says that tools and automation are not the answer - we need a better pattern.
If you use the DAO pattern, it is possible to completely hide your persistence mechanism from your application. It is possible, but is it a good idea? Separation of concerns and modularity are always good things, right? Andy Oliver argues that this is not always the case. I think he has a good point. You have to think about what you are trying to achieve. Sometimes separating concerns buys you nothing and just makes your system more complex.
In the case of the DAO pattern, the point is to separate the client portions of an application from the data access mechanisms and to allow the "data access mechanisms to change independently of the code that uses the data." I'm trying to understand the flexibility/complexity trade-offs of DAO. Here are the pros and cons I've assembled thus far:
Benefits of DAO pattern
Drawbacks of DAO pattern
org.exolab.castor.jdo.TimeStampable. Damn, your persistence engine just poked it's
ugly head out from behind the curtain of DAO.WSAD is the successor to IBM's VisualAge for Java. It was first released at the version 4 level about a year ago, and now, with version 5, it moves to an Eclipse 2.0 base, and adds full J2EE 1.3 support, as well as numerous enhancements. Roger's talk will introduce WSAD 5.0, with an emphasis on the Web Development side. He will also demonstrate some of the new items, including Struts Builder and Cheat Sheets.[From the RTP-WUG meeting annoucement]
I'm working at home this week on various geekly projects and I'm spending lots of time with Leo. He was already a happy little guy, but now that he can sit up he is overjoyed. You can see he is so proud of himself. I think that this time, from about 4 months to a 9 months old, is the sweetest time in baby development. Babies at this age can't move around and get into trouble. They can smile, laugh, coo, goo, and babble in a pleasant way, but they can't talk back at you. They never say "Dad, you are so lame" even when they should.
No, it's not just you Darren.
I use Aggie and I
have noticed that posts from Roller-based blogs often show up as
new when they are in fact old. Others have reported similar
problems with FeedReader and
now you are seeing this problem with Radio's aggregator. I'm
hoping that by fixing the following two bugs will resolve this problem:
I knew that Alan Williamson,
Editor-and-Chief of Java Developer's Journal, was the CTO of N-ary Consultancy. I did not
know that N-ary has it's own blogging software and that this software
runs the Blog-city site.
The blogging
software appears to be Cold Fusion based, but it may be a fusion of
CFML and JSP. Blog-City is powered by Blue Dragon,
N-ary's own proprietary app server that has the "unique ability to
combine JSP and CFML and to share resources between those pages."
Wait, isn't that what Cold Fusion
MX for J2EE does?
Disclaimer: The title Dragon Tales is not meant to imply that anybody is telling a lie. My kids like the PBS show Dragon Tales and Ord is the first thing that pops into my mind when I hear "blue dragon."
The goal of this [BasicPortal] project is to leverage a combination of several of the Apache Foundation's Jakarta projects into a simple vertical sample application that contains the functionality common to 80% of web projects -- we let developers customize the last 20%.
On the Struts mailing list, somebody asked for Struts-based CMS and Basic Portal was the answer. BasicPortal aims to be a best practices sample app, so I'm going to take a close look at the persistence layer.
This work is licensed under a Creative Commons License.
Copyright 2002-2007, David M Johnson (dave.johnson at rollerweblogger.org)
This is a personal weblog, I do not speak for my employer.

Buy now from Amazon.com
Or direct from Manning
| « November 2002 » | ||||||
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
1 | ||||||
8 | ||||||
22 | 23 | |||||
29 | ||||||
| Today | ||||||
Allen Gilliland
Anil Gangolli
Dan Axon
Danese Cooper
Film Babble Blog
Geertjan's Weblog
Henri Yandell
James Robertson
Jim Grisanzio
Josh Staiger
Linda Skrocki
Pat Chanezon
Rama
Ruby Sinreich
Simon Phipps
Tim Bray
Will Snow
Janne Jalkanen
Joe Gregorio
Matt Raible
Mike Cannon Brookes
Rafe Colburn
Sam Ruby
Simon Brown
My other sites