从头开始设计 MVC(Web)应用程序 ߝ我应该注意哪些基本(必要和可选)组件?
我即将编写一个相当大的网站,它基本上是一个论坛,分为(许多)不同的主题并允许用户评分。
我将使用 MVC,所以我(“天真地”)询问 这个关于如何分区模型部分的问题 MVC 的,可能非常大。
从得到的答案中我意识到两件事:
- 我真的不太了解设计软件。
- 实现 MVC 的方法有很多
,所以我现在有两个问题:(
- 这有点理论化 -) 你说设计软件是 完全确定性即- 对于 那里有一组具体的要求 是最好的设计吗?如果不是——为什么?
- 常见的组件有哪些 MVC 的(必需和可选) 我应该考虑写我的网站 (初学者的资源是 伟大的)?
I’m about to write quite a big web site that will basically be a forum, divided to (many) different subjects and allow users’ score.
I’ll be using MVC, so I (“naively”) asked this question about how to partition the Model portion of MVC, which is likely to be very large.
Two things I realized from the answers I got:
- I really don’t know much about designing software.
- There are many ways to implement MVC
So I have now two questions:
- (That’s a bit theoretical-) Would
you say designing a software is
completely deterministic i.e.- For a
specific set of requirements there
is one best design? If not- why? - What are the common components
(necessary and optional) of MVC that
I should consider in writing my site
(resources for beginners would be
great)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尽管以 Java/JSP/Servlet 为目标,但您可能会从 这个答案中获得一些有用的见解。它描述了 MVC 中使用的常见模式以及如何将它们组合在一起的方法。以下是摘要:
Although Java/JSP/Servlet targeted, you may get some useful insights out of this answer. It describes the common patterns to be used in MVC and the approach how to fit them all together. Here's a summary:
对于 ASP.Net MVC,Jon Galloway 的“MVC 2 Music Store”是一个很好的入门级免费教程。您可以找到它 此处。请注意,ASP.Net MVC 的当前版本是 MVC 2。
更全面的教程是 Nerddinner 教程。不过,创建者仍在将其更新到 MVC 2。您可以在此处检查更新和下载。
我建议使用 MVC 2 的资源,因为与第一个版本相比有一些重大改进。此外,MVC 3 即将面世,您希望立即开始使用。
如果您真的想快速了解这个领域,我还建议您关注 MVC 3 的改进。 Phil Haack 的 Haacked 是一个值得订阅的好博客。 Phil 是 Microsoft 的 MVC 项目经理。
就教科书而言,黄金标准是 Steven Sanderson 的“Pro ASP.Net MVC 2 Framework”。亚马逊上的第一篇评论来自微软副总裁 Scott Guthrie,他对这本书赞不绝口。他还有一本自己的竞争书。您可以在此处从 Apress 获取该电子书。在 google 上搜索 Apress 促销代码,您可能会节省几美元。
祝你好运。
For ASP.Net MVC, a good entry level, free tutorial is the 'MVC 2 Music Store' by Jon Galloway. You can find it here. Note that the current version of ASP.Net MVC is MVC 2.
A more thorough tutorial is the Nerd Dinner tutorial. However the creators are still in the process of updating it to MVC 2. You can check for updates and downloads here.
I would recommend using resources for MVC 2 as there are some significant improvements over the first version. Also MVC 3 is on the horizon and you want to hit the ground running.
I would also recommend keeping an eye on MVC 3 improvements if you're serious about getting up to speed in this space. A good blog to subscribe to is Phil Haack's Haacked. Phil is the project manager for MVC at Microsoft.
In terms of textbooks, the gold standard is Steven Sanderson's 'Pro ASP.Net MVC 2 Framework'. The first review on Amazon is from Scott Guthrie, a Microsoft VP, who raves about the book. He also has a competing book of his own. You can get the ebook from Apress here. Do a google search for Apress promo codes and you may save a few dollars.
Good luck.
软件绝对不是确定性的。编程理论不断发展和改进,这使得该领域成为一个快节奏且令人兴奋的工作场所。此外,目前看来解决软件问题的最佳方法可能会在几个月内被更新、改进的技术所淘汰。
Software is definitely not deterministic. Theories in programming are constantly developing and improving, which is what makes the field such a fast-paced and exciting place to work. Also, what may seem like the best approach to a software problem right now could be obsolete in a matter of months by a newer, improved technology.