是否有ASP.NET Web应用程序目录结构的命名约定? [英] Are there naming conventions for ASP.NET web application directory structures?

查看:76
本文介绍了是否有ASP.NET Web应用程序目录结构的命名约定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,我正在开发一个包含大约七个局部类,几​​个图标,三个页面和一个App_Themes文件夹的网站。我想知道,是否有一个行业标准的目录结构,可以用于比小型项目更大的事物?

Currently I am developing a site with about seven partial classes, a few icons, three pages and an App_Themes folder. I was interested to know, is there an industry standard directory structure for anything larger than a small project?

例如,我想将类保留在单独的文件夹中,图像放在单独的文件夹等中。我当前的目录结构如下(不完全是,这是从内存中获取的):

For example, I want to keep the classes in separate folders, the images in separate folders etc. My current directory structure is as follows (not exact, this is from memory):


  • (根)包含代码隐藏和形式

  • / App_Data

  • / App_Themes

  • / Bin

  • / Images

  • / Models-我从MVC那里偷了名字。听起来比类更合适

  • / FusionCharts-Flash图表库

  • (root) contains the codebehind and forms
  • /App_Data
  • /App_Themes
  • /Bin
  • /Images
  • /Models - I stole the name from MVC. It sounded more appropriate then 'classes'
  • /FusionCharts - a flash charting library

I简要介绍了MVC,它看起来像一个不错的目录结构,但是,我使用的是ASP.NET Ajax。

I briefly played with MVC, and it looked like a nice directory structure, however, I am using ASP.NET Ajax.

所以,我想问题是,您认为如何使此目录结构更有序?请给出您为什么做出决定的答案:)。

So, I guess the question is, is there a way to make this directory structure more orderly in your own opinion? Please give answers as to why you made your decision also :).

推荐答案

我喜欢受到Microsoft标准的启发,因为我们正在使用Microsoft技术。再加上好标准总比没有好,尤其是如果您在更大的团队中工作。

I like to be inspired by Microsoft standards, since we are using a Microsoft technology. Plus a somewhat good standard is better than no standard, especially if you work in a larger team.

App_Code当然是标准的,因为它在ASP.NET中具有功能,而不仅仅是最佳实践。

App_Code is standard of course, because it has a function in ASP.NET, not just a best practice.

我有点像MVC标准项目的结构:

I sort of like the MVC standard project's structure:


  • 内容-包含带有图像,Css,Javascript的子目录

  • 控制器-可能不适用在WebForms中

  • 视图-在WebForms中也可能过分使用

  • Content -- Contains subdirectories with Images, Css, Javascript
  • Controllers -- Maybe N/A in WebForms
  • Views -- Also maybe overkill in WebForms

内容文件夹可能是关键,因为它是ASP.NET项目的最低公分母。因此,如果您同时使用WebForms和MVC,就可以在所有项目中感到宾至如归,如果您知道该文件夹中有静态资源。

The "Content" folder is maybe the key, since it's the lowest common denominator for ASP.NET projects. So if you work with both WebForms and MVC you'll feel at home in all projects, if you know you have your static resources in that folder.

这篇关于是否有ASP.NET Web应用程序目录结构的命名约定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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