A simple comparison between NHibernate and Ibatisnet

Source: Internet
Author: User

NHibernate is the current ported version of the most popular Java o/R mapping framework Hibernate , and the current version is 1.0 rc-1. It was born in sf.net. Ibatisnet is another excellent Java o/R mapping framework, and the current version is 1.3. Currently belongs to Apache One of the sub-projects.
relative to the NHibernate"o/R",ibatisnet is a " Sql Mapping"of < Span style= "color: #808000;" > ORM implementation.
NHibernate provides a more complete encapsulation of the database structure, NHibernate , o/R Mapping implements the mapping between the PO and the database tables, and the automatic generation and execution of SQL . Programmers often simply define the mapping of the PO to the database tables and complete the persistence layer operation through the methods provided by NHibernate . Programmers do not even need to be proficient in SQL , and NHibernate will be based on the established storage logic, Automatically generate the corresponding SQL and call ado < Span style= "color: #808000;" > interface to execute. &NBSP
and ibatisnet focus on PO and The mapping relationship between SQL . That is, ibatisnet is not executed for the programmer to automatically generate SQL at run time. The specific SQL needs to be written by the programmer and then mapped to a configuration file that maps the parameters required for SQL and the returned result fields to the specified < Span style= "color: #808000;" > PO. The ORM mechanism provided by
using ibatisnet is for the business logic implementation personnel to face a purely DotNet object, this layer is implemented with NHibernate implementation ORM , and for specific data operations, the NHibernate automatically generates a SQL statement, and the Ibatisnet requires developers to write specific SQL statements. ibatisnet with SQL relative to NHibernate The workload of development and the concession of database portability provide more free space for system design.   Comparison of the two:
1. Ibatisnet is very simple and easy to learn,NHibernate relatively complex, the threshold is higher.
2.   Both are relatively good open source products.
3. When the system belongs to two development , cannot control and modify the database structure , that Ibatisnet will be more flexible than NHibernate . < Span style= "color: #808000;" > more suitable for
4 .   system data processing is huge and performance is extremely demanding, which often means we have to go through highly optimized SQL Statement (or stored procedure) to achieve system performance design metrics. In this case ibatisnet < Span style= "color: #808000;" > There will be better controllability and performance.
5 .   ibatisnet require handwriting SQL statements, or you can generate a section, NHibernate The is basically auto-generated and occasionally writes some HQL . The same requirement , ibatisnet is much more work than NHibernate . Similarly, if a database field is involved in a modification, the NHibernate is rarely modified, and the ibatisnet will take those SQL mapping The place one by one modifies.
6. Po and nhibernte , which are mapped in database field one by one , are obtained by this kind of object mapping. is very different, the essential difference is that the po is flattened, unlike the NHibernate -mapped PO can express three-dimensional object inheritance, aggregation and so on, which will directly affect your entire software system design ideas.
7. the most critical word is ibatisnet . The author of the article says:
If you're starting a new project and you ' re in the full control of your object model and database design, NHibernate is a goo D choice of O/R tool.
If You is accessing any 3rd party databases (e.g vendor supplied), or you ' re working with a legacy database, Or even just a really poorly designed database, then an O/R mapper might not being capable of handling the situation. That's were an SQL Mapper comes in handy

A simple comparison between NHibernate and Ibatisnet

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.