Since we’re not too terribly far from a 3.1.0 release, maybe the future is
now? I’d like to start a discussion about what exactly we intend to do w/r/t
backwards compatibility.
I see two areas in which there’s a backwards compatibility issue: custom
classes, and deprecated properties.
For custom classes: We’re reliant on module maintainers to act to update
classes which stop working. Its going to be difficult for us to prevent
custom class breakage, since the nature of VASSAL and Java (especially
reflection) makes it possible to modify the innards of VASSAL in ways that
we can’t possibly anticipate. The TurnTracker is rather unique, in the
sense that we knew it was a popular custom package, and then went ahead
and clobbered it anyway. (I’m not saying this was a bad decision, just
that we didn’t communicate what we were doing very well.) But in general
we’re probably not going to know, nor can we be expected to know, that
we’re doing something which will break custom code. This problem strikes
me as a social engineering one—we need to motivate module designers to
keep their modules up-to-date. I don’t know how best to do this.
What worries me more is the use of methods we’ve deprecated in custom code.
Here I think there’s a technical solution: When we deprecate methods, we
could add a call to raise a warning dialog alerting the user that a
deprecated method has been called, and that the module should be updated.
(This dialog could be set not to show again, of course. The point is to
notify, not to annoy.)
For deprecated properties: When I rewrote the Zoomer to handle lists of
zoom levels and to zoom to greater than 1:1, I found that I both needed
to add new properties to the Zoomer and deprecate the use of a few old
ones. The new Zoomer is still able to read the old properties, but will
not write them. Since the old Zoomer cannot read the new properties,
this means that a module saved with the new Zoomer but loaded with the
old one won’t have exactly the same list of zoom levels. For something
like the Zoomer, this is not much of a problem, but I could see this
sort of thing becoming a problem eventually.
Some software tracks version numbers of saved data in a way that is
more fine-grained than we do. I could imagine having getAttribute()
and setAttribute() which take a version number as an argument, and
do the right thing depending on the version number given. That, or
somehow rolling a version number as an attribute into individual
XML elements, so, you could have a
<VASSAL.build.module.map.Zoomer version="1">
the contents of which would be interepreted differently from
<VASSAL.build.module.map.Zoomer version="2">
or
<VASSAL.build.module.map.Zoomer>
(without a version attribute)
which would be interpreted as predating anything versioned.
I don’t know what a good way to handle this sort of thing is, because
I can foresee this generating a lot of code. Maybe the right way to
do this is to encapsulate all of this into a converter class? I wonder
how programs which can read all of the old versions of their file formats
do it without becoming buried in special-case code? (I haven’t looked
at Word in quite a while—and I would never hold it up as a model of
anything positive—but I seem to remember that it can read files from
every old version of Word, and even write files using the old file formats.
I wonder if they can do that without having a mountain of code?)