位于

和字社区

和字社区,欢迎各位光临!

iBATIS vs Hibernate

本主题共有 0 篇回复,最新回复发表于 08-01-2007 10:36 AM,作者 HeMa
页 1 / 1 (1 项)
帖子排序: 上一主题 下一主题
  • 08-01-2007 10:36 AM

    • HeMa
    • 灌水10强
    • 注册时间 06-07-2007
    • Canada
    • 发帖总数 233

    iBATIS vs Hibernate

    Re: iBATIS vs Hibernate
    Paul Barry
    Sat, 26 Feb 2005 18:22:28 -0800

    I don't know of a site with a detailed comparision, and if you find one, let me know. But I can tell you this difference boils down to this; iBATIS maps Java Objects to the results of SQL Queries, whereas Hibernate maps Java Objects directly to database tables, traditional Object-Relational Mapping. The benefits of Hibernate are that it automatically generates all the SQL for your and the cache invalidation can be more fine grained. iBATIS is more flexible especially if you are a strong SQL query writer. You have control over exactly how the SQL queries are written.

    When determining which framework to use, I think one thing to remember is that there is an optimal relational model to support every object model. There is not an optimal object model to represent every relational model. Use hibernate if you have mostly standard queries(CRUD, Find by Criteria, etc.) and if you are designing your object model first, then a relational model to support the object model. If you are working with a legacy system or a schema designed by a DBA, iBATIS often makes a better choice. If you try to shoehorn hibernate into a relational model created by a DBA who could care less about objects and thinks in terms of tables, columns, relationships and record sets, then you will get along better with your DBA if you use iBATIS, especially if the model is complex and may entail queries with outer joins and nested subqueries. You can tell them "All of the SQL statements used by my application are stored in these XML files outside of my Java code, so you can easily review them". DBAs like that. Of course, you might be lucky enough to work with a DBA that is familar with OO design and ORM tools like hibernate, in which case hibernate might make a better choice.

    Bottom line, in my experience, compared to Hibernate, iBATIS is more flexible, has a shorter learning curve, but can take more time to develop and maintain, since you have to write all your queries and if your object model changes you have to go through all your queries and make sure to make all the necessary changes to reflect the changes in your object model. I must admint though that I am biased because I have more experience with iBATIS. As I gain more experience with Hibernate, I could be singing a different tune.


    Tim Christopher wrote:
    Hi,

    Can anyone point me in the right direction of a site that compares
    iBATIS to similar products, ie. Hibernate.

    Cheers,

    Tim Christopher

    《和码》是最好最终的汉字形码,是一项有利于汉字与汉字使用者的重要技术。
页 1 / 1 (1 项)
www.HeZi.net 拥有版权
Powered by Community Server (Non-Commercial Edition), by Telligent Systems