什么是在任何应用程序中使用持久层? [英] What is the use of persistence layer in any application?

查看:165
本文介绍了什么是在任何应用程序中使用持久层?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要创建其中有人问我创建的应用程序中的持久层的应用程序。该应用程序是在.NET。我已经创建了业务层和presentation层,但我不知道如何和为什么要创造持久层。

I have to create an application in which I am asked to create an persistence layer in the application. The application is in .net. I have created business layer and presentation layer but I don't know how and why to create persistence layer.

我一派,才知道,持久层用于存储和数据库通常检索数据。

I googled and came to know that persistence layer is used for storing and retrieving data usually from a database.

能详细解释一下别人?

推荐答案

为您打造一个DAL(数据访问层)或任何其他类型的数据库引擎和业务/应用逻辑之间的中间层的原因,就是加入这一层在你们之间从你使用的是现在特定的数据库引擎/技术隔离应用程序的其它部分/上层。

the reason for you to build a DAL ( Data Access Layer ) or any other kind of intermediate layer between database engine and Business / Application logic, is that by adding this layer in the between you isolate the rest / upper layers of your application from the specific database engine / technology you are using right now.

这有几个好处,像其他存储引擎更容易迁移,单层更好的封装数据库逻辑的(更容易替代或更新版本修改取决于如何以及你设计的跨层接口等)

This has several advantages, like easier migration to other storage engines, better encapsulation of database logic in a single layer ( easier to replace or modify later depending on how well you have designed your cross-layer interfaces etc...)

看我最受好评的答案在这里,它是关于ASP.NET MVC和EF,但解决方案和项目的结构的一个例子实际上是技术无关的:的 MVC3和实体框架

see my most rated answer here, it is an example about ASP.NET MVC and EF but the structuring of solution and projects is actually technology independent: MVC3 and Entity Framework

也读过一些文章,以便更好地理解这件事情,例如: http://www.developerfusion.com/article/84492/net-and-data-persistence/

Also read some articles to better understand this matter, for example: http://www.developerfusion.com/article/84492/net-and-data-persistence/

这篇关于什么是在任何应用程序中使用持久层?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆