什么是在任何应用程序中使用持久层?

编程入门 行业动态 更新时间:2024-10-27 00:33:22
本文介绍了什么是在任何应用程序中使用持久层?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我要创建其中有人问我创建的应用程序中的持久层的应用程序。该应用程序是在.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 . 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

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

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

更多推荐

什么是在任何应用程序中使用持久层?

本文发布于:2023-11-05 03:58:25,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1559828.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:是在   应用程序   持久

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!