Maintaining a framework and applications based on that framework
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 w开发者_StackOverflow中文版hich 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
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.
精彩评论