Ado.net,ef,nhibernate comparison

Source: Internet
Author: User
Tags object model


1,ado.net belongs to the traditional data access tool, the development of the time we need to manually write operation of the database operations, of course, the performance is needless to say.

2,nhibernate is ported from Java to the. NET platform, writing mappings requires writing XML files manually, and then building the database,

Hibernate Advantages:

(1) object/relational database mapping (Basic O/R Mapping)

It only needs to manipulate objects, so that the development of more object-oriented, abandoned the idea of the database center, fully object-oriented thinking.

(2) Transparent persistence (persistent)

A Single-threaded object with a persistent state with a business function that has a short lifetime. These objects may be ordinary Javabeans/pojo, this object does not implement a Third-party framework or interface, the only special is that they are associated with (just one) session. Once this session is closed, the objects are detached from the persisted state, which can be freely used by any layer of the application. (for example, a data transfer object used to deal with the presentation layer.) )

(3) transaction transaction (org. Hibernate.transaction)

An object that the application uses to specify the range of atomic action cells, which is single-threaded and has a short lifecycle. It separates applications from the underlying JDBC, JTA, and CORBA transactions through abstraction. In some cases, more than one transaction object may be included within a session. Although it is optional to use this object, the opening and closing of transaction boundaries is essential whether using the underlying API or using the transaction object.

(4) It is not intrusive, that is, the so-called lightweight framework.

(5) Transplant will be very good.

(6) Caching mechanism. Provides first-level caching and level two caching.

Hibernate Disadvantages:

(1) Hibernate in the batch data processing is a disadvantage.

(2) For an object (a single object) simple check change \ delete increase, not batch modification, deletion, suitable for using Hibernate, and for batch modification, deletion, not suitable for hibernate, which is also the weakness of the or framework; To use a specific optimization mechanism for a database, Not suitable for hibernate.

The 3,entity Framework application has the following advantages: applications can work through more application-centric conceptual models, including types with inheritance, complex members, and relationships. Applications no longer have hard-coded dependencies on a particular data engine or storage schema. You can change the mapping between the conceptual model and the storage-specific schema without changing the application code. Developers can use a consistent Application object model that can be mapped to various storage schemas, which may be implemented in different database management systems. Multiple conceptual models can be mapped to the same storage schema. Language-Integrated Query support provides a query with compile-time syntax validation for a conceptual model.

Some of the drawbacks I think:

· EDMX contains all the objects of the CSDL,SSDL,MSL file, too large, if you want to manually modify this file, accidentally, eyes look at the flowers, it is wrong. (As with the dataset).

· Currently the EF supports tables, attempts, stored procedures, other objects are not supported, and there are many restrictions on using stored procedures (there are currently efextension to provide more object support).

· In addition to the visual design interface that MS SQL Server can provide directly, other databases currently do not provide a visual design interface (but can be implemented by themselves, as described later).

    performance issues. (Online see there is said than ado.net slow 70,000, and some people say faster than ado.net, the specific situation I have not tested, but I feel like this type of framework, performance is certainly more than the original ecological ado.net slow)

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.