创建新解决方案时如何安排源代码的结构 [英] How can i structured to arrange source code when i create a new solution

查看:78
本文介绍了创建新解决方案时如何安排源代码的结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我想创建一个解决方案,并结构化地安排源代码.
目录信息如下.

解决方案1 ​​
../CODE
../CODE/AL
../CODE/AL/BseAlc//AL项目
../CODE/AL/BseAlc/*.CS
../CODE/AL/BseClass//AL项目
../CODE/WB
../CODE/WB/WebService//WB项目
../CODE/XD
../CODE/XDBse/Tds//XD项目
../Solution1.sln
../Solution1.suo
../Solution1.vssscc
../...
我该怎么办.

Hi,everybody,
I want to create a solution,And structured to arrange source code.
The directory information is as follows.

Solution1
../CODE
../CODE/AL
../CODE/AL/BseAlc //AL Project
../CODE/AL/BseAlc/*.CS
../CODE/AL/BseClass //AL Project
../CODE/WB
../CODE/WB/WebService // WB project
../CODE/XD
../CODE/XDBse/Tds // XD Project
../Solution1.sln
../Solution1.suo
../Solution1.vssscc
../...
How can i do.

推荐答案

首先,知道什么是源代码,什么不是源代码.因此,删除* .suo和VSS工件. (无论如何,这些天谁在使用Visual Source Safe?请参见下面的"//"符号).现在,其他一切完全取决于您.但是,请尝试使解决方案中包含的所有项目都低于.sln文件的级别,并且使每个项目的所有源代码都低于相应的*.* proj文件的级别.

您也可以在项目之间重用某些文件,但是除非绝对必要,否则我不建议您使用.为此,可以将该文件包含在一个或多个项目中作为链接,可以使用文件打开对话框中的添加为链接"选项来完成此操作.

现在,这是一个额外的建议:

甚至不要想起没有修订控制系统的想法, http://en.wikipedia.org/wiki/Revision_control [ ^ ].

如今,如果没有这样的系统,绝对没有任何借口可以工作.好处是巨大的,但您的努力可能微不足道.该系统可以是开源的(我认为必须是免费的),它可以占用空间很小且功能强大,它可以可靠,可扩展且不引人注目,因此您的开发不会有任何变化,直到当您遇到任何麻烦时.

请查看此讨论(当然有我的回答):版本控制系统,可供选择? [需要一些单词设置和/或使用服务器的明智方法(答案1) [需要一些单词设置和/或使用服务器的明智方法(答案2) [
First of all, know what is source code and what is not. So, remove *.suo, and artifacts of VSS. (Who uses Visual Source Safe these days, anyway? See below.) Your ''//'' notation is not clear. Now, everything else is totally up to you. However, try to have all projects included in the solution below the level of your .sln file and all the source code of each project below the level of respectful *.*proj file.

You can also reuse some files between projects, but I would not recommend it unless it is absolutely necessary. To do that, include this file in one of more project as a link, which can be done using "Add as link" option in the file open dialog.

Now, here is a bonus advice:

Don''t even play with the idea of going ahead without a Revision Control System, http://en.wikipedia.org/wiki/Revision_control[^].

These days, there is absolutely no excuses for working without such system. The benefits are great, but your efforts can be insignificant. The system can be Open Source (and I think it must be) and free of charge, it can be of tiny footprint and powerful, it can be reliable, scalable and unobtrusive, so your development won''t change in a bit — until the moment you get into any kind of trouble.

Please see this discussion (with my answer of course): Revision control systems, which to choose from?[^].

See also my past answers:
Needs some words of wisedom to set up and/or use a server (answer 1)[^].
Needs some words of wisedom to set up and/or use a server (answer 2)[^].

At least, go away from the crowd of losers using Microsoft Visual Source Safe. This product is intrusive, proprietary, non-portable, bases on a number of misconceptions; one of the main misconception is the lack of transactional approach. After all, it is not supported by Microsoft.

—SA


这篇关于创建新解决方案时如何安排源代码的结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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