我正在学习 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.
发布评论
评论(2)
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.
您发布的数据访问教程链接是 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.