NHibernate learning notes (1)

xiaoxiao2021-03-05  23

NHibernate learning notes

One - what is NHIBERNATE?

O / R Map refers to the object / relationship mapping, which is a technique of relationship framework of the class programming language with data persistence. After using O / R MAP, the focus of development can be placed on the business logic, so that development efficiency can be improved.

Hibernate is a Java open source project that handles O / R MAP.

NHibernate is open source project in .Net, the purpose is also to provide O / R MAP solution. NHibernate is a .NET based on object persistence class library for relational databases. NHibernate comes from a very excellent Java-based Hibernate relational persistence tool.

NHibernate persists from the bottom of the database to the relational database. NHibernate has handled these, far better than you have to write SQL to get from data inventory. Your code is just just with an object association, NHibernat automatically generates a SQL statement and make sure that the object is submitted to the correct table and field.

We know that the program actually data processing, we need to enter data, process data, and then output data. The currently processed data may be used next time. Restrictions on memory, etc., in many cases, the data processing must be persisted.

Data persistence typically writes data to a file and reads according to the structure written. On this basis, a database, that is, to access the data method independent technology. This data access technology actually solves almost half issues in the program (personal understanding), so such a technique is in software technology giants (IBM MS ORCAL is a database giant, but also software giants).

However, database technology has encountered problems in class programming (object-oriented). We can analyze the software problem when designing the software problem, but these classes have to hold their own state to manipulate data access, from the perspective of software (joking, actually It is considered from the comprehensive quality of the software. It will lead to the least object-oriented code to flood our encoding. In order to solve these problems, some people in Java have proposed Hibernat projects to solve the mapping problem between Object. After .Net launched, there is a good thing to transplant to the .NET environment, called NHibernat.

From the current POST of the current learners, basically NHibernat has not reached practical levels, and some projects often collapse at large loads or some problems, but this will improve, I want to know NHibernat. Design ideas, you will believe that it will come out and it is the version. The latest version is 1.1

NHibernat http://nhibernate.sourceForge.Net/ The official site is Beta 0.7.0.0. If you are in the latter, there is a VS2003 project file, including the source code of NHibernat, and a test project.

To learn about NHibernat, you can read some quikstarts first, give some Chinese documents:

http://www.moon-soft.com/doc/44941.htm

http://www.cnblogs.com/ccboy/archive/2004/07/25/27158.aspx

I want to analyze the internal implementation of NHibernat and how to apply. It should take some time. I will write the feelings of reading the source code according to my understanding.

转载请注明原文地址:https://www.9cbs.com/read-38918.html

New Post(0)