frameworks

R

Rizwan

iBATIS or Hibernate? which one is better? or is there anyone which is better
than these two?

Thanks
 
C

Chris Smith

Rizwan said:
iBATIS or Hibernate? which one is better? or is there anyone which is better
than these two?

I'm answering only because there's apparently no one more qualified to
answer for you. I've used Hibernate extensively, and my only exposure
to iBATIS was to read their web site briefly.

It appears that iBATIS involves a lot more SQL work than Hibernate and
leaves you to solve more of your own problems, but it requires a lot
less conceptual understanding. iBATIS basically seems to be about
mapping a ResultSet to an object, and nothing else. Hibernate is more
concerned with the hard problems: caching and connection pooling;
representing relationships between entities in a very flexible and
customizable way, etc. As a result, iBATIS appears to be mostly about
avoiding the effort of writing repetitive glue code from JDBC, while
Hibernate is about abstracting away from JDBC and treating data
according to the object model instead.

Which meets your needs is up to you. I suppose it would depend on the
nature and size of your project. Hibernate appears to have the wider
target audience there.

As for other alternatives, there are plenty. Assuming you're just
interested in O/R mapping vendors (and not pure object persistence
stores), there's CocoBase, TopLink, a plethora of JDO providers, EJB-
CMP, and more.

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
K

kumardain

Not sure if it's exactly the same animal - but you may want to look
on the data gateway from vermilion software
(www.vermilionsoftware.com). They are seeming to suggest JDBC, XML and
MS-Excel originators (similar to Hibernate - although I not sure if
Hibernate can do Excel) and seemings to have few other 'different'
features that look of interest; reading between the lines I guessing
it's hiding the technologies of the underlying drivers behind some
Java class library but I not been able to work out much detail from
their website and can't find much else about the package presently.
If you have access to Gartner or ButlerBloor reports you might want to
see what they say.

-kumar
 
A

Arun Saraswat

Chris Smith said:
I'm answering only because there's apparently no one more qualified to
answer for you. I've used Hibernate extensively, and my only exposure
to iBATIS was to read their web site briefly.

It appears that iBATIS involves a lot more SQL work than Hibernate and
leaves you to solve more of your own problems, but it requires a lot
less conceptual understanding. iBATIS basically seems to be about
mapping a ResultSet to an object, and nothing else. Hibernate is more
concerned with the hard problems: caching and connection pooling;
representing relationships between entities in a very flexible and
customizable way, etc. As a result, iBATIS appears to be mostly about
avoiding the effort of writing repetitive glue code from JDBC, while
Hibernate is about abstracting away from JDBC and treating data
according to the object model instead.

I would disagree slightly with the above post. In general, with my
experience using iBatis vs. hibernate, I would go with iBatis if you
are dealing with an existing DB schema (* especially if it is a poorly
designed one *). If you are on a project where you are developing
both the application and the DB concurrently, then I would go with
hibernate/xdoclet.

ibatis is VERY flexible and forgiving of poor DB design, and when you
are STUCK with a DB schema, as I am on my current project, it seems to
be the only choice.

As for the connection pooling and transaction management, it allows
you to plug in various frameworks using config files. So, you can use
apache commons dbcp for the pool, or use a JNDI resource to leverage
your app server's pool and transaction management, etc. As for
caching, you can configure your caching scheme in the iBatis config
files (LRU scheme, flush on events or timed interval, etc.) - the key
with iBatis is FLEXIBILITY

iBatis is comprised of two main products - DAO and SQLMaps. The DAO
provides an excellent way of abstracting the persistence layer while
the SQLMaps provides your basic Object/Relational Mapping
functionality.

I would definitely recommend iBatis 2.0 (*latest release at time of
this post*).

The only negatives I've seen so far:
- no automatic code generation tools (* such as middlegen for
hibernate *) - but from what I hear and read, the iBatis team is
working on it.
- poor documentation - I found some errors, but mainly syntax from
previous versions (* I would recommend looking at the iBatis team's
JPetstore example to see proper implementation of the framework *)

Hope this helps.

Arun Saraswat
Software Engineer
 
A

Arun Saraswat

Chris Smith said:
I'm answering only because there's apparently no one more qualified to
answer for you. I've used Hibernate extensively, and my only exposure
to iBATIS was to read their web site briefly.

It appears that iBATIS involves a lot more SQL work than Hibernate and
leaves you to solve more of your own problems, but it requires a lot
less conceptual understanding. iBATIS basically seems to be about
mapping a ResultSet to an object, and nothing else. Hibernate is more
concerned with the hard problems: caching and connection pooling;
representing relationships between entities in a very flexible and
customizable way, etc. As a result, iBATIS appears to be mostly about
avoiding the effort of writing repetitive glue code from JDBC, while
Hibernate is about abstracting away from JDBC and treating data
according to the object model instead.

I would disagree slightly with the above post. In general, with my
experience using iBatis vs. hibernate, I would go with iBatis if you
are dealing with an existing DB schema (* especially if it is a poorly
designed one *). If you are on a project where you are developing
both the application and the DB concurrently, then I would go with
hibernate/xdoclet.

ibatis is VERY flexible and forgiving of poor DB design, and when you
are STUCK with a DB schema, as I am on my current project, it seems to
be the only choice.

As for the connection pooling and transaction management, it allows
you to plug in various frameworks using config files. So, you can use
apache commons dbcp for the pool, or use a JNDI resource to leverage
your app server's pool and transaction management, etc. As for
caching, you can configure your caching scheme in the iBatis config
files (LRU scheme, flush on events or timed interval, etc.) - the key
with iBatis is FLEXIBILITY

iBatis is comprised of two main products - DAO and SQLMaps. The DAO
provides an excellent way of abstracting the persistence layer while
the SQLMaps provides your basic Object/Relational Mapping
functionality.

I would definitely recommend iBatis 2.0 (*latest release at time of
this post*).

The only negatives I've seen so far:
- no automatic code generation tools (* such as middlegen for
hibernate *) - but from what I hear and read, the iBatis team is
working on it.
- poor documentation - I found some errors, but mainly syntax from
previous versions (* I would recommend looking at the iBatis team's
JPetstore example to see proper implementation of the framework *)

Hope this helps.

Arun Saraswat
Software Engineer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top