重写NHibernate的应用程序在LINQ

重写NHibernate的应用程序在LINQ

本文介绍了重写NHibernate的应用程序在LINQ to SQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我使用NHibernate写旧的过时的应用程序。现在我想改写它包括新的功能和模型大的变化。I have an old outdated application written using NHibernate. Now I would like to rewrite it including new functionality and big changes in model.什么是使用LINQ to SQL的,而不是NHibernate的主要缺点是什么?What are main disadvantages of using Linq to SQL instead of NHibernate ?什么是使用LINQ中可能出现的问题到SQL,并使得DataContext的,就像这样的单身可以给表现不佳?What are possible problems of using LINQ to SQL, does making DataContext as something like singleton can give poor performance?推荐答案 从的在DAL封装数据访问虚假的神话:From "The false myth of encapsulating data access in the DAL":我想设计使用NHibernate的系统/应用程序,但我也希望如此灵活,在未来,如果我拔掉NHibernate的和使用ADO.NET实体框架或其他框架,然后我的应用程序不应该崩溃。在总之,我彻底反对为甚至还试图做这样的事情。In short, I am completely opposed foreven trying doing something like that. 这是基于有缺陷的假设很多背后的驱动器是一个基于建于,其中的数据访问层使用其自己直接访问数据库当时的历史驱动器上的方言,导致需要创造这样在以支持多个数据库的封装。A lot of the drive behind this isbased on the historical drive built inthe time where data access layersdirectly accessed a database using itsown dialect, resulting in the need tocreate just such an encapsulation inorder to support multiple databases.与此驱动器的问题是,它不再是一个因素,所有现代或/ MS能够有效地处理多个数据库。此外,现代或/ M是不再只是方式来执行一些 SQL和得到的结果回来了,这是旧式DAL是如何写的。一个或/ M呈现出更多的的责任,从像改变的事情,从确保乐观并发,来管理与$最佳通信跟踪,缓存管理, b $ b中的数据库。The issue with this drive is that itis no longer a factor, all modernOR/Ms can handle multiple databaseseffectively. Moreover, modern OR/M areno longer just ways to execute someSQL and get a result back, which ishow old style DAL were written. AnOR/M takes on a lot moreresponsibilities, from things likechange tracking to cache management,from ensuring optimistic concurrencyto managing optimal communication withthe database.和这些功能的事,很多。没有不仅如此,但他们每个OR / M之间不同的And those features matter, a lot. Notonly that, but they are differentbetween each OR/M. 它不工作,你会发现得太晚的主要问题是,无论多么你怎么努力,也将是微妙而不是不同的OR /小姐之间如此微妙的差别,这些变化可以大大影响你如何建立你的应用程序。The main problem is that no matter howhard you try, there are going to besubtle and not so subtle differencesbetween different OR/Ms, those changescan drastically affect how you buildyour application. 那么,你如何与移动或/小姐?有原因,为什么有些人想从一个数据访问技术转移到另一个。我参与了几个这样的努力,我们在每一个这些案件中使用的方法是的的移植的,而不是试图砸一个新的IDataAccess实现。There are reasons why some people want to move from one data access technology to the other. I was involved in several such efforts, and the approach that we used in each of those cases was porting, rather than trying to drop a new IDataAccess implementation. 这篇关于重写NHibernate的应用程序在LINQ to SQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-13 02:12