代码组织:Google 如何组织其代码?

发布于 2024-11-02 20:51:43 字数 862 浏览 5 评论 0原文

简史:我在一家开发商店工作,我们开发了很多基于 ASP.NET 的产品。随着我们公司投资组合的增长,我们在开发方面面临着严峻的问题。我们有大约 10 个模块出售给客户,我们希望它们在一个 URL 下出售。考虑与谷歌服务(搜索/电子邮件/金融/等)的类比。

每个模块都有自己的生命周期,并且有自己的一组更新,这些更新按照计划发布进行,无需与其他模块同步。

因此,我们当前使用的结构是:

  • 我们有一个最外层外壳网站,其中包含所有常见功能(用户/菜单管理/角色/等)。
  • 这个最外层外壳(如上所述)应有自己的库来支持其功能。
  • 每个单独的模块都分为自己的 Web 应用程序和相应的库。
  • 现在,当进行构建时,我们编写自定义 msbuild 脚本将所有模块部署为单个网站。
  • 我们还有脚本,可以在必要时负责部署各个模块,而不影响整个系统。

上面的设置一直工作得很好,直到我发现它的规模问题......即,当我们的系统中有 10 个模块时,每个开发人员都必须将所有 10 个模块下载到他的本地系统。另外,我还没有找到一种方法来控制特定模块的生命周期,同时仍然保持 TFS 结构完整。

我们现在面临的问题是在 TFS 中组织代码,这将帮助我们实现以下目标:

  • 在开发人员的计算机上占用更小的空间(开发人员获取他/她正在处理的模块),而不是所有的
  • 单独部署。单个模块的部署不应在任何时间点影响其他模块(除非它是一个主要版本......并且它应该始终是一个计划的版本)
  • 单独的生命周期管理:我必须能够维护多个版本TFS 中的模块并相应地工作。

平台:TFS 2010、Visual Studio 2010、C#、jQuery、CSS

Brief history: I work for a development shop, and we do a lot of ASP.NET based products. As our company portfolio grew, we are facing a tough issue on the development side. We have about 10 modules that we sell to client(s), and we want them to be sold under one url. Consider the analogy to google's services (search/email/finance/etc.).

Each module has its own life-cycle and it's own set of updates that go as their planned releases that don't necessary have to be in sync with other modules.

So, the current structure we have been using is :

  • We have a outermost shell website that contains all the common functionality (user/menu management/roles/etc)
  • This outermost shell (mentioned above) shall have its own library to support its functionality.
  • Every individual module is split into its own web-application and a corresponding library
  • When a build takes place, right now, we write custom msbuild scripts to deploy all modules as a single website.
  • We also have scripts that shall take care of deploying individual modules if necessary without affecting the whole system.

The above setup has been working just fine, until I discovered its issues with scale...i.e., when we have 10 modules in the system, every developer has to download all 10 modules to his local system. Also, I am yet to figure out a way to be able to control the life-cycle of a particular module, while still maintaining the TFS structure intact.

The problem we have right now is to organize the code in TFS that would help us with the following :

  • smaller foot-print on a developer's machine (developer gets the modules he/she is working on) and not everything
  • Individual deployment. Deployment of a single module should not affect the others at any point of time (unless its a major release...and it shall be a planned release always)
  • Individual life-cycle management : I should necessarily have to be able to maintain multiple versions of the module in TFS and work accordingly.

Platform : TFS 2010, Visual Studio 2010, C#, jQuery, CSS

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

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

发布评论

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

评论(1

禾厶谷欠 2024-11-09 20:51:43

我不是这方面的专家,但在我看来,您需要将开发过程与客户访问分开。

网站及其资源应具有独立于模块的结构和部署。

您的构建和部署脚本应该负责从存储库构建新的生产环境。

开发结构不应该依赖于网站的结构。

I'm not an expert on this, but it seems to me that you need to separate your development process from your access for customers.

The website and its resources should have an independent structure and deployment from the modules.

Your build and deployment scripts should take care of constructing the new production environment from the repositories.

There should be no dependency of the development structure on the structure of the website.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文