维护框架和基于该框架的应用程序

发布于 2024-09-03 12:10:40 字数 348 浏览 5 评论 0原文

我编写了一个简单的框架(实际上是库的集合)和许多基于该框架的应用程序。这些框架和应用程序都有自己的 Mercurial 存储库。当我更新框架存储库时,我将所有框架文件一一复制到应用程序文件夹中。这个工作流程让我有些头疼,比如我不知道上次更新应用程序中的框架是什么时候,是什么版本。

我对更好的工作流程有两个想法,想知道您的意见。

  • 构建工具可以更新框架文件夹中文本文件中的版本文本并将其导出到应用程序文件夹。

    构建工具可以更新框架文件夹中文本文件
  • 我可以在应用程序存储库中使用子存储库(我不知道如何做到这一点)

谢谢!

注意:我的代码库是 PHP

I have written a simple framework (actually collection of libraries) and a number of applications based on that framework. These framework and applications both have their own mercurial repositories. When I update the framework repository, I copy all framework files to application folders one by one. This work flow causes me some headaches, such as I do not know the last time I have updated the framework in application and which version it is.

I have two ideas about better work flows and wanted to know your opinion.

  • A build tool can update the version text in a text file in framework folder and export it to application folders.

  • I may use sub repositories in application repositories (I don't know how to do that)

Thanks!

Note: My codebase is PHP

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

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

发布评论

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

评论(1

染墨丶若流云 2024-09-10 12:10:40

听起来您需要更好地“版本化”您的框架。如果您在开发框架的同时开发应用程序,特别是如果您正在开发多个应用程序,那么您会有点头疼。

您应该做的是将您的应用程序限制为仅使用框架的特定版本。当您想在框架中实现新功能时,可以将其添加到新版本中。然后,您可以决定要将哪些应用程序升级到新版本,并将其作为一个完全独立的过程来执行。

无论您做什么,都不要修改现有框架实现的核心框架代码,除非您打算将其完全升级到下一个版本。另外,请确保每个新版本都基于最新版本构建 - 您不希望拥有具有不同功能的多个开发版本,因为您的代码库(和维护要求)将呈指数级增长!

编辑:再次阅读您的问题,我觉得我还应该提到,自动化任何类型的升级过程都不是一个好主意。在一个存储库中升级框架主干,然后如果需要,您可以在应用程序存储库中手动升级到新版本。但前提是您需要当前版本中不可用的功能或优化。

Sounds like you need to "versionize" your framework better. If you're developing an application at the same time as your framework, and especially if you're developing MULTIPLE applications, then you're sort of asking for a headache.

What you should do is limit your applications to just each use a specific version of your framework. When you want to implement a new feature into your framework, you add it into a new version. Afterwards, you can decide what applications you want to upgrade to the new version, and do this as an entirely separate process.

Whatever you do, DO NOT modify the core framework code of an existing framework implementation unless you are going to completely upgrade it to the next version. Also, make sure that each new version is building on the most recent version-- you don't want to have multiple development versions with varying features as your codebase (and maintenance requirements) will increase exponentially!

EDIT: Reading your question again, I feel I should also mention that automating any sort of upgrade process is not a good idea. Upgrade your framework trunk in one repository, then if you need to, you can manually upgrade to a new version in an application repository. But only if you need features or optimization unavailable in the current version.

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