MVC 模式与 DAL/BLL 设计模式有何不同(如果有的话)?

发布于 2024-07-07 18:26:35 字数 314 浏览 8 评论 0 原文

我正在学习 Microsoft 的早期数据访问教程 ASP.NET 网站,我发现这一切似乎与我读到的关于使用 MVC 模式。 作为一名新手,我还没有实现 MVC 模式,但我很好奇这两种设计结构有何不同,以及我是否应该将注意力集中在其中一个上,特别是在网页设计的背景下。

I'm making my way through the early Data Access Tutorials on Microsoft's ASP.NET website and it occurred to me that this all seems awfully similar to what I have read about separating your logic and presentation code using the MVC pattern. As a newbie I have yet to implement the MVC pattern but I'm curious as to how these two design structures differ and if I should be focusing my attention on one or the other, particularly in the context of web design.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

丘比特射中我 2024-07-14 18:26:36

MVC 不仅仅解决数据访问问题。 在MVC中,DAL和BLL都被合并到模型中。 视图定义了模型数据如何呈现给用户,而控制器则响应用户输入(Web 上的 GET/POST)。

MVC 的替代方案是经典的 N 层架构,其中有表示层、业务层和数据访问层。 在这种架构中,视图和控制器的组件被包装在表示层中。 WebForms/WinForms 是 N 层架构的一个示例,而 ASP.Net MVC 是 Microsoft 领域 MVC 的一个示例。

MVC addresses more than just data access. In MVC, both the DAL and BLL is incorporated into the Model. The view defines how the model data is presented to the user, while the controller is what responds to user inputs (GET/POST on the web).

An alternative to MVC is a classic N-tier architecture where you have a presentation layer, a business layer, and a data access layer. In this architecture, the components of the view and controller are wrapped together in the presentation layer. WebForms/WinForms is an example of the N-tier architecture, while ASP.Net MVC is an example of MVC in the Microsoft space.

(り薆情海 2024-07-14 18:26:36

您发布的数据访问教程链接是 MVC 模式的实现。 MVC模式是一个概念,实现可以有所不同; 在 ASP.NET 中有这个,而在 Java 中有一个名为 Struts 的框架,它是一种 MVC 实现。

达尔和 BLL 模式与 MVC 模式在概念上有所不同; 但不是这个具体的实现。 MVC实际上是通过使用DAL、BLL和DAL来实现的。 查看模式。

The link you've posted for the Data Access Tutorial is implementation of MVC pattern. MVC pattern is a concept, implementation can differ; you have this in ASP.NET whereas in Java there's one framework called Struts, which is an implementation MVC.

DAL & BLL patterns differ from the MVC pattern in terms of concepts; but NOT this specific implementation. MVC is actually achieved through usage of DAL, BLL & View Patterns.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文