Enjoy NHibernate

xiaoxiao2021-03-06  14

I started from the beginning of the program (92 years), using Microsoft's things, from qbasic, foxpro, vb, vc to .net, lazy "enjoy" Microsoft provides everything, Microsoft is almost Not concerned, including Java in the same year. At that time, the idea was "writing code with development tools".

But later, what is more and more like, and I found that Microsoft will sometimes twist! So I started learning software engineering and a lot of things, which began to touch some J2EE fields, and began to discover Microsoft's immature for enterprise applications. There is a mature enterprise application framework in Microsoft's current system. Especially if there is no set of data persistence frameworks, you can only use ADO.NET in data access (you can understand "Table Mode", see the "Enterprise Application Schematic Mode" of Martin Fowler). DataSet is actually a code model for relational data, but according to object-oriented concepts, we need a domain model. This requires us to have an O / R mapping mechanism, and the .NET 1.1 version does not give us ready-made. In the past, I have seen some data persistence frameworks in China on www.uml.org.cn, but the defects are much. In an occasion of discussion of data persistent layers, I saw that the J2EE field has a lightweight data persistence framework for Hibernate. According to my experience, the excellent open source project in J2EE is generally used in accordance with my experience. Net version. Sure enough, NHibernate was found on the SourceForge, which was still 0.4alpha version (the latest 0.7 Beta). The process of learning NHibernate is a bit difficult because there are too little data, mostly relying on hibernate Chinese information, China is also a good entry information is the "Zhang Lao San" website.

So far, I have been able to use NHibernate to do some applications. But NHibernate's system is large (such as complex HQL, NHibernate performance adjustment, etc.). With NHibernate, we can forget the existence of the database when developing applications. We basically don't have to care about what databases (without using some databases, there is no need to write a lot of SQL, only Need seriously thinking and designing real logic! !

From now on, Microsoft's next-generation development tool whidebey (approximately this summer or later), has an ObjectSpaces data persistence layer, I don't know if it is NHibernate so powerful. Who let us do this, but also learn to learn a brother. However, at least before WHidbey, NHibernate is still the best, I started such a nhibernate article column in my blog, I want to share NHibernate development skills and knowledge, I hope to go to everyone's valuable advice and criticism.

Finally, let us thank the great open source engineers!

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

New Post(0)