NHibernate is the most popular ported version of the Java O/R mapping Framework Hibernate, and the current version is 1.0.2. It was born in Sf.net..ibatisnet is another excellent Java O/R mapping framework, the current version is 1.2. Currently belongs to Apache one of the sub-projects.
Relative to the NHibernate " O/R", Ibatisnet is a " Sql Mapping" The ORM implementation.
nhibernate provides a more complete encapsulation of the database structure, nhibernate o/r mapping implements the mapping between po and database tables, and po to the database table mapping, you can nhibernate Provides a method to complete the persistence layer operation. Programmers do not even need to sql proficiency, nhibernate based on the established storage logic, automatically generate corresponding sql and calls ado.net The interface is executed.
and ibatisnet The focus is po and sql . That is, ibatisnet does not automatically generate sql for programmers at run time. The specific sql need to be written by the programmer, and then by mapping the configuration file, sql the required parameters, And the returned result fields are mapped to the specified PO.
Using the ORM mechanism provided by Ibatisnet, for the business logic implementation personnel, the face is pure DotNet object, this layer is basically consistent with the implementation of ORM through NHibernate, and for the specific data operation, NHibernate generates SQL statements automatically, while ibatisnet requires developers to write specific SQL statements. Relative to NHibernate, ibatisnet the workload of SQL development and the concession of database portability, which provides more free space for system design.
Comparison of the two:
1.Ibatisnet is very simple and easy to learn,The NHibernate is relatively complex and the threshold is higher.
2.Both are relatively good open source products.
3.When the system belongs to two times development, unable to control and modify the database structureThatIbatisnet's flexibility will be greater thanNHibernate more suitable for
4.The huge amount of system data processing and the extremely demanding performance requirements often mean that we have to pass highly optimizedSQL statements (or stored procedures) to achieve system performance design metrics. In this caseIbatisnet can have better controllability and performance.
5.Ibatisnet need handwritingSQL statements can also be generated as part of theNHibernate can basically be generated automatically, occasionally writing somehql . The same demand ,ibatisnet a much larger workload than nhibernate . Similarly, if the database field is involved in the modification, nhibernate modify the place very little, and ibatisnet to put those sql mapping place one by one modified.
6 . The most critical sentence is ibatisnet author said:
if You is starting a new project and you ' re in the full control of your object model and database design, NHibernate is a good choice of the O/R tool.
if you is accessing any 3rd party databases (e.g. vendor supplied), or your ' re working with a LEGAC Y database, or even just a really poorly designed database, then an O/R mapper might not being capable of handling the Situat Ion. That's were an SQL Mapper comes in handy
everyone happy National Day!
NHibernate VS ibatisnet