20040202 Monday February 02, 2004

One big Service class or several small classes? I asked this question on the Spring Forums a couple of days ago, but I didn't get a response, so I'll try it here.

Looking through the Spring's petclinic and jpestore applications - both seem to advocate one single class to interface with the database (hibernate or dao/ibatis). I also noticed this pattern in Java Open Source Programming. Is this a recommended pattern or do you still think there's value in several service-level classes (i.e. one for each DAO)? I imagine the single interface and impl could grow quite large on a big project. In fact, in the Spring examples, the Manager isn't even a Business Delegate, it's really a Persistence Manager.

BTW, the Petclinic app is a helluva plug for Hibernate. The Hibernate implementation class is 53 lines, and the JDBC implementation class is 770 lines! If you're still using JDBC over Hibernate, please explain why you put yourself through the pain?

I do like the simplicity of the Single Manager approach, but I tend to do 1 Manager for each DAO (or something resembling this pattern). What do you advocate? AppFuse follows the 1-Manager to 1-DAO pattern. Should I switch to the Single Manager pattern? Posted in Java at Feb 02 2004, 09:44:39 AM MST 19 Comments

JavaBlogs and Roller's duplicate post problem Charles has figured out why JavaBlogs gets duplicate posts from Roller-based blogs. And Dave proposes a solution:

I just now changed the JRoller "absolute URL to site" setting to force the domain name to jroller.com. The setting was blank before.

Without this setting, the JRoller feeds were using whatever hostname was requested at cache refresh time. So if the first request after the cache timeout was for freeroller.net then the GUID's in the RSS feed would read freeroller.net until the next cache timeout.

This site was missing the absolute URL to site setting as well, so I changed it to http://raibledesigns.com. I'll try adding myself back to JavaBlogs aggregator and hope that works! Posted in Java at Feb 02 2004, 08:46:25 AM MST 3 Comments

Click me to subscribe
Matt Raible is a Web Architect who enjoys developing applications with open source technologies. Contact me for rates.
« February 2004 »
SunMonTueWedThuFriSat
6
7
12
14
15
20
21
22
28
29
      
       
Today

Recent Entries

Tag Cloud