ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Clinton Begin" <clinton.be...@gmail.com>
Subject Re: Which to choose : iBatis or Hibernate
Date Sat, 07 Jul 2007 15:13:12 GMT
I should be the most biased person right?  ;-)  Maybe not....

> is my assumption right. Does Hibernate have
> namespace support like in iBatis.

Well...yes.  Possibly better.  Hibernate simply uses the package
structure in which you place the XML files as the namespace (just like
a class), because it's a mapping between classes and tables.  iBATIS
has a more abstract/artificial namespace that's only needed because
you can put the files anywhere.  I actually prefer Hibernate's
approach, and it's something we may use in iB3.  With SQL Mapping in
Annotations and possibly some generated CRUD stuff in iB3, the
namespaces really become blurred.  The only people who will not like
that approach are those who don't like putting their XML mapping files
in their classpath (which I'm hoping is rare -- I see no reason to put
them anywhere but in the classpath).

As a more general recommendation, I'd say:  If the database for your
application already exists, then use iBATIS.  If you get to create it
from scratch, use Hibernate.

There are other factors of course...if your app is heavily based on
reports or complex/large queries and lists of lots of objects...then
iBATIS will be significantly faster and easier in the long term.  But
if it's pretty much a form based CRUD app, Hibernate will do nicely
and will save you some typing.  Also, how much OO experience does your
team have vs. SQL experience?

Anyway, in the end you should run two spike tests of each framework.
Implement a vertical slice of your application, preferrably one of the
more difficult ones, using both.

Also, consider this post to our list last week:

"I am responsible for building a scalable and high performance data
access layer for our keyword search application, which is of
distributed nature, and have convinced the team for IBATIS. We did
some pilot and comparative studies for our requirements IBATIS is
winner among pure JDBC, IBATIS, Hibernate, Java Persistence


On 7/5/07, Ashok Madhavan <ashok.madhavan@gmail.com> wrote:
> Hi All,
> we are presently using iBatis in one of our project. In that project there
> are lots of objects which need the CRUD and some CRUD + something more. we
> really like the namespace feature in iBatis and use to the max here. We use
> Abator to do the code generation. We use a common DAO ( and Impl) for those
> object which just need the CRUD. In those cases where the object needs
> additional methods other than CRUD, we create new DAO Interface and Impl for
> those additional methods. We use the namespace to differentiate the
> different objects. With Spring, we inject the proper namespace and the
> proper dao. We use Struts for the front-end. We inject the DAO into Struts
> using Spring. For objects needing just CRUD, we use the same Action class.
> For objects needing more than CRUD, we extend this action class and
> implement the new methods.
> So if need a new object which needs CRUD, all we need to do is
> create java objects/xml with abator
> create new JSPs
> create new struts mapping
> add struts changes to the spring config file. If we need a new Object which
> has CRUD + more, all we do is
> first four steps as above
> New Dao and Impl extending the common DAO and Common Impl for the additional
> methods.
> New Action Class extending the common Action class for the additional
> methods.
> and we are done. The productivity of the team is pretty high because of the
> above reasons. And testability is sky-high too.
> Now i am coming to my question. In a new project, we are also thinking of
> Hibernate. For this project most of the people who will be working will  be
> new to Hibernate as well as iBatis. I feel with the name space stuff,
> code-generator etc, iBatis provides a better approach with respect to fast
> churn of testable code. other things like performance etc might remain the
> same.
> is my assumption right. Does Hibernate have namespace support like in
> iBatis.
> Looking forward for your valuable comments and suggestions.
> regards
> Ashok

View raw message