编写适用于原始应用的多个版本的修改。

huangapple go评论70阅读模式
英文:

Writing a modification for multiple versions of the original application

问题

我正在为特定版本的Java应用程序编写修改。我修改现有代码并添加了我自己的特殊代码。

现在,当原始Java应用程序在进行重大代码库更改的更新后,我希望我的修改能适用于那个新版本,但是复制我所有的代码并更新我对原始源代码所做的所有更改将会非常困难且耗时。当我编码一个新功能时,我将不得不将整个功能复制到多个原始应用程序版本中。

我的目标是同时支持多个版本,但我想知道是否有一种更简单(或更有效)的方法来做到这一点,以便我将自己的代码保存在一个公共位置,并且只需调整部分其他代码。

提前感谢!

英文:

I am writing a modification for a specific version of a Java application. I modify the existing code and add my own special code into it.

Now, when the original Java application gets an update with major codebase changes and I would like my modification to be available for that new version, it would be really hard and time consuming for me to copy all of my own code and update all changes that I made to the original source code. When I code a new feature, I will then have to copy the whole feature for multiple versions of the original application.

My goal is to support multiple versions simultaneously, but I am wondering if there is a simpler (or more efficient) way of doing this so I keep my own code in a common location and only adapt some other parts of the code.

Thanks in advance!

答案1

得分: 0

没有简单的解决方案。

您分叉了一个应用程序,原始开发人员对您的分叉一无所知,而且即使他们知道,他们也没有义务采取任何措施来保持兼容性。

如果您的分叉对他人有潜在价值,您应该游说将其贡献给原始项目,并成为该项目的贡献者。否则,您需要将基础版本的每个新版本与上一个版本进行差异化比较,然后调整您的代码以处理新版本引入的任何不兼容性。

英文:

There is no simple solution.

You forked an application, the original developers know nothing of your fork, and regardless, even if they did they are not required to do anything to maintain compatibility.

If your fork potentially has value to others, you should lobby to contribute it to the original project, and become a contributor on that project. Otherwise, it will be up to you to diff every new version of the base against the previous version and then adjust your code to deal with any incompatibilities introduced by the new version.

huangapple
  • 本文由 发表于 2020年9月1日 04:53:25
  • 转载请务必保留本文链接:https://go.coder-hub.com/63678043.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定