在 ASP.NET MVC 中启动应用程序的好方法

发布于 2024-08-12 14:34:45 字数 296 浏览 4 评论 0原文

当您开始在 ASP.NET MVC 中创建应用程序或站点时,在输入第一行代码之前您会做什么?

我个人喜欢创建一个新的 ASP.NET MVC Web 应用程序项目,然后清理控制器/视图,直到获得本质上是空白的项目(即它可以运行但不提供功能)。然后我开始处理我的模型并根据需要添加控制器/视图。

我还阅读了有关入门套件和示例应用程序的信息,但我尚未开始积极使用其中任何一个。然而,在我的阅读中,我看到作者建议从现有模板开始并在其基础上构建可能会更好。

我正在尝试确定是否有更好的方法来启动项目,以便节省时间和/或最终交付的质量更高。

When you start creating an application or site in ASP.NET MVC, what do you do before typing in that first line of code?

I'm personally fond of creating a new ASP.NET MVC Web Application project and then cleaning out controllers/views until I have what is essentially a blank project (i.e. it runs but doesn't offer functionality). Then I start working on my model and adding controllers/views as needed.

I've also read about starter kits and sample applications but I have not yet started actively working with any of them. However, in my reading I have seen authors suggest that it might be good to start off with an existing template and build on it.

I'm trying to determine if there are better ways of starting off a project such that time is saved and/or the resulting deliverable is of higher quality.

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

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

发布评论

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

评论(3

何其悲哀 2024-08-19 14:34:45

我做的其他事情(我还清除了控制器/视图等)

将 IOC 放置到位。
将 ELMAH 放入项目中。

然后我喝了杯咖啡,写了我的第一个测试。

善良,

PS:在某个时候,我将抽出时间为此创建一个模板,这样我就不会每次都重做。一旦我决定了我最喜欢的国际奥委会。 :-)

The other things I do (I also clear out the controller/views etc)

Put an IOC in place.
Put ELMAH into the project.

Then I grab a coffee and write my first test.

Kindness,

Dan

PS: At some point I shall get around to creating a template for this so I don't redo it everytime. As soon as I decide upon my favourite IOC. :-)

最初的梦 2024-08-19 14:34:45

我通常也会清除 Content 文件夹,并放置一个漂亮的 CSS 重置文件和/或 CSS 框架,例如 960格

I usually clear out the Content folder as well and put in place a nice CSS reset file and/or a CSS framework like the 960 grid

梦冥 2024-08-19 14:34:45

在开始任何类型的项目之前,您必须知道自己想做什么。因此,拿一张纸并开始在此处书写:

  • 应用程序的名称
  • 枚举功能
  • 快速起草域模型(您将拥有的实体)
  • 尝试找到您将要实现的方法(选择技术)做不同的事情,例如:数据访问、验证(客户端和服务器端)、日志记录、IoC、安全性、缓存等。
  • 快速草拟应用程序中将拥有的所有视图
  • 确定您可能需要解决的任何其他问题/实施/开发并思考你将如何做到这一点

Before starting any type of project you must know what you want to do. So take a sheet of paper and start writing on here:

  • The name of your application
  • Enumerate the features
  • Make a quick draft of the domain model (entities that you are going to have)
  • Try finding the ways (choosing a technology) you are going to do different stuff like: data access, validation (client and server side), logging, IoC, Security, Caching etc.
  • Do a quick draft of all the views you are going to have in your application
  • Identify any other problems you might need to solve/implement/develop and think how are you going to do that
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文