为数据库开发人员解释 MVVM、MVC、MVP
我有数据库开发/质量检查背景。我还没有详尽地研究过 UI 项目,尽管我编写了其中的 DB 部分。我想了解 MVC、MVP、MVVM 模式之间差异的一些基本示例。
在非常高的水平上,读几次后就知道了,我知道
- P - 表示层
- M - 模型
- C - 控制器 - 解释表示层并向模型发送要呈现的内容的操作
这是非常高水平的说明。我还没有尝试使用 MVVM、MVC、MVP 创建一个基本的简单示例。
如果您能更清楚地说明这与典型的 3 层架构有何不同
- UI 层 - ASP / WPF
- 业务层 - Web 服务 (.NET 2.0/WCF..)
- DB 访问层 - EF、ADO.NET、存储程序
提前感谢您的帮助
I am from Database Development / QA background. I have not exhaustively worked on UI projects, Althought I coded DB part of it. I would like to know some basic examples for differences between MVC, MVP, MVVM patters.
On a very high level know after few reads I know
- P - Presentation layer
- M - Model
- C - Controller - Interprets presentation layer and sends action to model on what to be presented
This is on a very high level note. I have not tried creating a basic simple example using MVVM, MVC, MVP.
Would appreciate if you can provide some more clarity on how this is different from typical 3 layered architecture
- UI Layer - ASP / WPF
- Business Layer - Web Services (.NET 2.0/WCF..)
- DB Access Layer - EF, ADO.NET, Stored procedures
Thanks in Advance for your help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您将设计模式与软件架构混淆了,它们既相关又不同。
3 层架构由 UI、逻辑和持久性代码组成。使用 MVC 或 MVVM 之类的东西只是提供了一种很好的方法来分离这些位。
在 3 层环境中,您可能有一个 MVVM 应用程序,其中
这三件事只是 UI 层。
WCF 服务是您的业务逻辑层,它公开 UI 将使用的模型,并对从 UI 接收的数据执行业务逻辑,然后在适当的情况下调用持久层将更改保存到数据库中。
I think you're confusing Design Patterns with Software Architecture, they are related but different.
A 3-layer architecture consists of UI, Logic, and Persitance code. Using something like MVC or MVVM simply provide a nice way to seperate these bits out.
In a 3-layer environment, you might have an MVVM App where the
Those three things are simply the UI layer.
The WCF Service is your business logic layer, it exposes the Models that the UI will use, and it performs business logic on the data that it receives from the UI, then if appropriate, it invokes the persistance layer to save the changes into a database.