Hibernate's AdminApp - a demo of WW2 and Hibernate
After looking at Hibernate's AdminApp, as well as other WW2 apps - I've noticed something. WW2 developers don't seem to give a rats ass about referencing their POJOs in their Actions, or using Hibernate directly in their actions. At first glance, I think to myself, "boy that sure makes things easier." But then again - doesn't that tightly couple your web layer to your persistence layer?
I can understand the POJO reference in Actions - I'm about to give up on doing a parent/child relationship with Hibernate where the children are converted to ActionForms and then converted back (Hibernate loves to tell me "a different object with the same identifier value was already associated with the session: 1").
It would be SO much easier (with this particular problem) if I could just toss up POJOs to my view. The thought of importing "persistence.User" into my Action makes me cringe though. I don't know why, it just does. I need to get out of this patterns mindset I've been in for the last couple of years and get back to what really matters - simple, easy to learn, and fast to develop. I'm tired of banging my head against the wall with Struts and Hibernate.... I've been doing it for two days. It's not Hibernate, and it's not Struts, it's me... (thud, thud, thud).
Posted by Anders on December 17, 2003 at 10:40 PM MST #
Posted by patrick on December 17, 2003 at 10:48 PM MST #
Posted by Jason Carreira on December 17, 2003 at 10:49 PM MST #
Posted by Christian Bauer on December 17, 2003 at 10:56 PM MST #
Posted by Bo on December 17, 2003 at 11:43 PM MST #
Posted by John Cavacas on December 17, 2003 at 11:46 PM MST #
Posted by Matt Raible on December 17, 2003 at 11:54 PM MST #
Posted by Jason Carreira on December 18, 2003 at 03:22 AM MST #
Posted by Robert Nicholson on December 18, 2003 at 04:41 PM MST #
Posted by Matthew Payne on December 18, 2003 at 08:53 PM MST #
One thing you might consider is checking out the Spring framework: http://www.springframework.org. I believe that there are some interesting things in the framework that may help you with the design/structure of your applications. They follow the DAO pattern, however lots of DB details like Transactions can be specified when you wire up the framework.
I also believe that it's very struts-friendly.
I'm using Hibernate + Spring + another web-component framework called Echo. So far the whole thing is jelling together quite nicely. I know that at any point I'll be able to drop in the Apache DBCP and not have to change one bit of my application code. Just have to re-wire the Spring framework which consists of one xml config file.
Personally I found Struts to be very confusing. Too much mucking around in XML files to hook everything up... But now that I'm much more experienced in Java and using XML files to define the hook ups in an application, I'll probably have to take a look at the framework again. Probably take a look at AppFuse as well! :)
Posted by mnickel on December 18, 2003 at 09:35 PM MST #
That should be the http://www.springframework.org
My bad... sorry
Posted by mnickel on December 18, 2003 at 09:36 PM MST #
Posted by Robert Nicholson on December 18, 2003 at 09:42 PM MST #
If I were smart (and had the time), I'd implement an optional comment alert system like this site (scroll down to "Comment alerts" heading).
Posted by Matt Raible on December 18, 2003 at 09:51 PM MST #
Posted by Sam Newman on December 19, 2003 at 02:25 PM MST #