ASP.NET MVC 2 Preview 1 - 实现区域的最佳方法是什么?

发布于 2024-07-30 01:49:41 字数 1116 浏览 7 评论 0原文

在最新版本的 ASP.NET MVC 2 中,他们推出了 MS 支持的区域概念。 然而,要执行这一领域的概念,必须创建多个单独的项目。 每个地区一个项目。 在 ASP.NET MVC 1 中,还有许多其他方法可以支持您仍在同一项目中工作的区域。 这篇文章不是关于区域是否重要或不是,而是正确的实施方式是什么。 您对区域工作的偏好是什么?为什么? 您如何看待这种新的多项目表演区域方式?

以下是 2.0 之前实现区域的方法:

http:// haacked.com/archive/2008/11/04/areas-in-aspnetmvc.aspx

http://blog.codeville.net/2008/11/05/app-areas-in-aspnet-mvc-take-2/

http://devlicio.us/blogs/billy_mccafferty/archive/2009/01/22/mvc-quot-areas-quot-as-hierarchical-subfolders-under-views.aspx

我即将开始我正在开发一个非常大的 ASP.NET MVC 项目(并且迫不及待地想深入了解 2.0 预览版),并且想知道我是否应该使用这个新区域实现或我们已经证明可以工作的内容。

In the latest release of ASP.NET MVC 2 they have launched the concept of areas as supported by MS. However to perform this areas concept one has to create multiple separate projects. One project per area. In ASP.NET MVC 1 there were many other ways out there to support areas where you would still be working within the same project. This post is not about whether areas are important or not but what a proper implementation would be. What is your preference for working with areas and why? What do you think of this new multi-project way of performing areas?

Here were the pre 2.0 ways to implement areas:

http://haacked.com/archive/2008/11/04/areas-in-aspnetmvc.aspx

http://blog.codeville.net/2008/11/05/app-areas-in-aspnet-mvc-take-2/

http://devlicio.us/blogs/billy_mccafferty/archive/2009/01/22/mvc-quot-areas-quot-as-hierarchical-subfolders-under-views.aspx

I am about to start working on a very large ASP.NET MVC project (and can't wait to dig into the 2.0 preview) and am wondering if I should use this new areas implementation or what we have already proved to work.

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

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

发布评论

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

评论(3

你在我安 2024-08-06 01:49:41

由于 ASP.NET MVC 2 的发布有时是不确定的,因此我建议您执行 MVC 1 所提供的操作。但是最好在实现您的项目时考虑到区域功能,这样如果需要的话,您可以在以后更轻松地扩展现有的解决方案。

Since the release of ASP.NET MVC 2 is sometimes in the future which is uncertain, I'd recommend that you do what has been offered by MVC 1. But it'd be great to implement your projects with the area feature in mind so that you could extend your existing solution much easier later on if needed.

蔚蓝源自深海 2024-08-06 01:49:41

我建议您查看 ScottGu 的有关 MVC 2 新颖性的博客文章。 还有一个带有区域的文件/文件夹结构的漂亮屏幕截图。

我给你的建议是:
如果您计划在 MVC2 中开发大型 Web 应用程序,我建议您采取使用已实现的区域功能的路径。 当您完成开发时,MVC 将发布并且无论如何都会支持区域。

只是不要重新发明轮子并以此产生某种您自己的解决方案。

但如果您不从 V2 开始,请使用 Haack 的面积解决方案。

I'd recommend you look at ScottGu's blog posta about MVC 2 novelties. There's also a nice screenshot of file/folder structure with areas.

My advice to you would be this:
If you plan to develop your huge web app in MVC2 I suggest you do take the path of using already implemented areas capability. By the time you finish developing it, MVC will ship and areas will be supported anyway.

Just don't reinvent the wheel and produce some sort of your own solution with this.

But if you won't start in V2, go with Haack's solution of areas.

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