Monday February 28, 2005
Hibernate vs. iBATIS
There's an interesting thread taking place on the iBATIS User Mailing List. The basic jist of the responses are: Hibernate works well when you control the data model, iBATIS works well when you need to integrate with an existing database. I've said this for a couple years now, and I still believe it. Furthermore, I've found that when working with iBATIS, I tend to know what's going on a lot more. After all, it's just SQL. From all the questions on the AppFuse mailing list, it seems like a lot of Hibernate users are constantly trying to get Hibernate to "work its magic" and handle all their relationships for them.
I wonder if newbies would be better of using iBATIS? Using iBATIS, there isn't a whole lot of magic, and you get full control over the SQL - which would likely be easier to understand. Maybe I should create a "newbie" version of AppFuse - where the frameworks uses are the easiest to learn or most documented. It'd probably be Struts+Spring+iBATIS, or maybe just Spring+iBATIS so I could sell more copies of Spring Live.
Posted in Java
at Feb 28 2005, 07:10:25 AM MST
32 Comments
Search This Site
Recent Entries
- Jack's Mohawk
- LinkedIn Cuts 10% (a.k.a. The Journey is Over)
- Happy Birthday Abbie!
- Moving from Spring's XML to Annotations in AppFuse
- Free Maven Training in New Orleans on Election Day
- AppFuse Light ยป AppFuse, Maven Archetypes and Shared Web Assets
- Great Weekend in Montana
- Colorado Software Summit 2008 Wrapup
- RESTful Web Applications with Subbu Allamaraju
- Core Animation with Bill Dudney
2. Regarding Spring Live: is there really and advantage for the autor to publish a book in "live mode", instead of the tradional one? (since only a few books use this strategy - compared to the high number of IT books)
Posted by Ahmed Mohombe on February 28, 2005 at 10:12 AM MST #
Ahmed, there is an absolute advantage to publishing a book in the "live mode", especially when dealing with the open source model. Let's look at Matt's book. In the next few months, Spring will release version 1.2. At that time, Matt will most likely make additions to "Spring Live" that will cover the new functionality and features. This would be near impossible with the traditional model.
With the "live mode", it seems to be the difference in writing solely history or history with current event updates.
Of course, I am *slightly* biased.
Cheers,Matthew Porter
Posted by Matthew Porter on February 28, 2005 at 11:24 AM MST #
Posted by Ahmed Mohombe on February 28, 2005 at 11:31 AM MST #
Posted by Wayland Chan on February 28, 2005 at 12:12 PM MST #
Posted by Vinny Carpenter on February 28, 2005 at 07:17 PM MST #
Posted by PJ Hyett on March 01, 2005 at 12:02 AM MST #
What you said sounds like from some politician :), or some manager that don't wan't to rise my wage :).
to Vinny:
"People are so happy that they can debug an application". This is simply not true. People are so happy when they don't need to debug an application - they use unit tests (and test cases) to prevent it from the begining. Besides, if the application is so well designed like AppFuse, than you can separate your concerns, so only in extreme situations one realy needs to debug the application as an entire, and to step in every library.
I personally like all the magic from AppFuse/Hibernate/AppGen/middlegen/hibernate_synchronizer/etc. . Concentrating on the the essential in an application is really fun. If I would want to controll everything than I would end up with Assambler.
Why do ask so many people here about Hibernate?
Because Hibernate is bad? No! Most of the users get scared on the Hibernate forums and when they don't get the RTFM, than some half answer that mostly doesn't help a newbie. Matt on the other hand, explains everything so good that even newbies understand this - IMHO this is the key difference.
Posted by Ahmed Mohombe on March 01, 2005 at 03:41 AM MST #
Posted by Jaime F. Zarama on March 01, 2005 at 08:22 AM MST #
Posted by anon on March 01, 2005 at 08:53 AM MST #
I personally like iBatis better due to my strength in SQL. Hibernate's abstraction of SQL doesn't allow me to truly understand what's happening. Plus the ability to write custom SQL in Hibernate buys very little for the complexity. I can appreciate those people who don't have a solid understanding of SQL and their use of Hibernate. I just find that level of abstraction unnecessary and more complex especially when something goes wrong.
Posted by Chris Rosenquest on March 01, 2005 at 02:44 PM MST #
Posted by Rick Hightower on March 01, 2005 at 05:26 PM MST #
Posted by 211.144.200.89 on March 01, 2005 at 07:27 PM MST #
Posted by Christopher K Koenigsberg on March 03, 2005 at 10:53 AM MST #
Posted by 204.114.53.254 on March 17, 2005 at 01:07 PM MST #
Posted by PJ Murray on April 06, 2005 at 09:37 AM MDT #
Posted by Matt Raible on April 06, 2005 at 10:07 AM MDT #
Posted by Gabriel on April 09, 2005 at 06:59 AM MDT #
Posted by Adam Waldal on June 09, 2005 at 08:14 PM MDT #
Posted by Adam Waldal on June 09, 2005 at 08:24 PM MDT #
thanks
Posted by abdullah beik on September 27, 2005 at 11:44 PM MDT #
Posted by Matt Raible on October 04, 2005 at 12:58 PM MDT #
Posted by Jeeva on January 19, 2006 at 10:15 PM MST #
Posted by Matt Raible on January 23, 2006 at 09:43 AM MST #
Here in my company, www.gamatechno.com, we are starting to use JEE as a production environment. But, because there are sooo many opts, three of us demonstrate the use of their options to implement some --very-- simple Guest Book application.
I opt to use Spring + Hibernate + Velocity (? .. JSF). But then again, after reading the opinions about iBatis, well, I was seduced (sad isn't it?).
Dear GOD, is there a way to make me confident of what I choose?
Well, I look at all the technologies use by www.alfresco.com, so... I opt that technologies too : Spring + Hibernate + JSF
So, Mr. Raible, ... can you ... well, help me????
With Regards,
Eko SW
P.S. : JSF Vs. Velocity/Freemarker , maybe I choose Velocity, because (they said) the separation of work between HTML Designer and JAVA programmer can be done easily.
Posted by swdev on August 08, 2006 at 04:35 AM MDT #
Both Spring MVC and WebWork allow you to use JSP, Velocity or FreeMarker. I'd recommend using JSP unless you have a good reason not too. JSP 2.0 is a must.
Posted by Matt Raible on August 08, 2006 at 07:52 PM MDT #
I'm doing a very simple web project that needs to get off the ground quickly, it's a project where our team (3 developpers) have BASIC experience in HTML, JSP, and database experience. We want to get a look on some nice technologies, but don't necessarily have a lot of time for a steep learning curve. What would you suggest : Struts vs Spring, iBatis vs Hibernate. Our application has simple CRUD operations and simple page flow.
Thanks.
Pascal.
Posted by Pascal on October 27, 2006 at 10:57 AM MDT #
From the choices you've given, I'd recommend Spring MVC over Struts. As far as iBATIS vs. Hibernate - I think iBATIS is easier to learn, but I continue to choose Hibernate for most of the applications I write. Then again, I've been using Hibernate since 2003. ;-)
Posted by Matt Raible on October 29, 2006 at 01:33 PM MST #
Long time no talk to...
I recently tried to use Hibernate as part of a new SOA architecture with a legacy model 1 JSP application. The legacy app had enormously long SQL statements and a very poor db schema. We ended up abandoning Hibernate. Ibatis made it easy for us to create CRUD DAOs and work with the existing schema mess. Creating dynamic finders were easy too. We're sold on Ibatis. It works really well with Spring.
I've heard Hibernate advocates claim you'll need hibernate for advanced use cases. I've not found that to be the case. I'm a big fan of KISS. Ibatis fits the bill. Hibernate is too complex and quirky. If you don't think so, read this page... http://hibernate.org/109.html From this URL it sounds like hibernate has not worked out some of the most basic persistence object identity issues. Problems like that make an application unstable at runtime, and are very difficult to solve.
If I was going to start a new app from scratch, and had the time to learn the "right way" to use Hibernate, I might take the plunge again. However, you've got to consider that others will follow in modifying your code, and they'll have to learn Hibernate too.
Another persistence framework to consider may be the one included with http://ofbiz.apache.org/ I don't think it's designed to be used stand-alone, but I think some projects have used it that way, notably Jira. It hides the underlying database the way Hibernate does, but it also adds db columns as needed.
I'd like to see a Java framework that dynamically builds CRUD (list and detail) as fast as plone/RoR/etc that includes security, optimistic locking, client-side validation, etc. I'm considering building a portlet for Liferay.com that allows you to build a CRUD portlet and edit it at runtime, adding table columns, etc.
Sorry for the long winded post. I've been thinking about this stuff a lot lately.
mike
Open Source Software Solutions
Posted by Mike Lawrence on January 29, 2007 at 07:21 PM MST #
Posted by pobs on January 31, 2007 at 06:17 AM MST #
Posted by A_flj_ on April 13, 2007 at 12:15 AM MDT #
Posted by Gaurav on May 10, 2007 at 03:51 PM MDT #
Posted by Matt Raible on May 25, 2007 at 10:10 AM MDT #