新的 MVC2 区域有何出色之处?

发布于 2024-09-09 04:59:20 字数 148 浏览 1 评论 0原文

有人可以解释一下使用新的 MVC2 Areas 功能的优点和缺点吗?

我不明白他们有什么了不起。如果我要向 MVC 应用程序添加管理区域,为什么不在主 Views 和 Controllers 文件夹中创建一个新的 Admin 文件夹?创建一个区域到底能给我带来什么?

Could some one please explain the advantages and disadvantages of using the new MVC2 Areas feature?

I don't understand what is so great about them. If I am adding an admin area to my MVC application why not create a new Admin folder in the main Views and Controllers folder? What does creating an area really get me?

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

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

发布评论

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

评论(1

呆萌少年 2024-09-16 04:59:20

菲尔·哈克是这样说的:

区域解决的场景是
能够分区你的
应用到离散领域
功能。它有助于管理
大型应用程序更易于管理
并允许创建独特的
您可以将其放入的小程序
应用程序。

管理部分不符合小程序的资格,因为它在逻辑上属于您的应用程序,甚至可能与其共享模型。

This is what Phil Haack says:

The scenario that areas address is
being able to partition your
application into discrete areas of
functionality. It helps make managing
a large application more manageable
and allows for creating distinct
applets that you can drop into an
application.

An admin section wouldn't qualify as an applet as it logically belongs with your application and may even share models with it.

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