组织在我的项目中的文件的最佳方法 [英] Best way to organize the files in my project

查看:79
本文介绍了组织在我的项目中的文件的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是组织在项目中的文件的最佳方式?

What is the best way to organize the files in your project?

例如你把所有的用户控件在一个单独的文件夹或你将它们放在一个子文件?你有业务逻辑的文件夹?一个辅助类文件夹?

For example do you put all user controls in a separate folder or do you place them in a sub folder? Do you have business logic folder? A helper classes folder?

我来组织我的项目是这样的:

I used to organize my projects like this:

项目/用户控件/模块名称/
项目/班/模块名称/

Project/User Controls/Module Name/ Project/Classes/Module Name/

现在我学习更倾向于这样的事情:
项目/模块名称/用户控件/
项目/模块名称/班/

Now I am learning more towards something like this: Project/Module Name/User Controls/ Project/Module Name/Classes/

什么是最好的办法吗?尤其是在项目变得非常大?应该存在什么类型的文件夹结构的?

What is the best way? Especially if the project gets really big? What type of folder structure should exist?

推荐答案

第一个文件夹分离的目的是要文档的额外级别,让程序员发现code更容易。这意味着你不应该有额外的水平只是组织的东西。这不包括命名类文件夹,控件等。

First the purpose of folder separation is to be an extra level of documentation, to let the programmers find code easier. That means you should not have extra levels "just to organize stuff". That excludes folders named Classes, Controls, etc.

一些例子:

如果您在你应用层工作,它会成为一个很大的意义有类似:

If you work on a thee tier App it would make a lot of sense to have something like:

项目\\层(型号|控制器|等)\\类名

Project\Tier (Model|Controller|etc)\Classname

如果你的程序是大,有独立的功能区的时候,我会一起去:

If you program is big to the point of having separate functional areas I would go with:

项目\\功能区\\层(型号|控制器|等)\\类名

Project\Functional Area\Tier (Model|Controller|etc)\Classname

当子团队在不同功能区的工作是特别有用的。

That is particularly usefull when sub-teams work on the different functional areas.

另外从很深的文件夹树(恕我直言,比4的深度是太多了)不要,让您的文件夹名称紧凑。一些工具可能对路径的大小低至255个字符的限制,所以这是一个地方,简洁有它的地方。

Also refrain from very deep folder trees (IMHO, more than depth 4 is too much) and keep your folder names compact. Some tools might have limitations on path size as low as 255 chars, so this is one place where brevity has its place.

这篇关于组织在我的项目中的文件的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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