MVC最佳设计模式 [英] MVC best design pattern

查看:160
本文介绍了MVC最佳设计模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在盯着一个新的MVC应用程序。哪种设计模式最适合MVC应用?



谢谢,

Srinivas

Hi,

I am staring a new MVC application. Which design pattern is most suitable and fit into MVC application?

Thanks,
Srinivas

推荐答案

MVC本身就是一种架构模式。因此,当您使用MVC时,您正在将视图控制器和模型分离。
MVC itself is an architectural pattern. So when you use MVC, you are decoupling the view controller and model.


您可以遵循存储库模式。

在决定体系结构之前,您需要请记住很多因素,例如

1 - 层之间的松散耦合

2 - 代码可维护性

3代码可重用性

总是尝试使用通用模式方法来实现可重用性,并尝试在层之间实现最小的依赖性。

最好的方法是将.Edmx文件放在Infrastructure文件夹而不是核心文件夹中。

请点击以下链接获取洋葱建筑

洋葱建筑

这是非常好的分层架构。

有很多架构,但这是一个新的,非常简单易用。

希望这有帮助

谢谢

:)
You can follow repository pattern for this.
Before deciding the architecture, you need to keep in mind many factors like
1-Loose coupling between layers
2-Code maintainability
3-Code reusability
Always try to have a generic pattern approach for reusability and also try for minimal dependency amongst the layers.
The best thing is to put the .Edmx file in the Infrastructure folder rather than in the core folder.
Please follow the following link for Onion Architecture
Onion Architecture
This is very nice and layered architecture to follow.
There are many architectures but this is a new and very simple to use.
hope this helps
Thanks
:)


这篇关于MVC最佳设计模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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