Hello,
I'm looking for a way to manage different versions of functions to execute some task.
Let's say, I want to create a mailing tool, that sends newsletters to subscribed people.
In a first step (version 1), (as I need it rather quickly), I would do a simple text-tool. Later, I would like to improve for HTML-mail (version 2), and still later, I think about optionally generating PDF output (version 3).
Now, i would like to be able lateron to retrieve the data from any newsletter from the database, and reuse it with the appropriate version it was created in.
As functionality increases, more datafields are supposed to be added, so the functions also need to change.
Of course, I'll need to flag the data in the database with version-information.
But how could I manage to have the different versions of the functions in parallel? I thought about appending a version numbering to the function name, like function1_v1(), function2_v2(); later: function1_v2(), function2_v2(), etc.
But this does not seem very elegant to me. It would mean that I have to fiddle around on function namesto append versioning information, and I might still go into trouble with possibly different number of parameters.
What would you suggest resolve this problem?
Thanks for your advice.
JJM