One idea I have had for a while has been to investigte what level of
actual compatibility there is between "close enough" minor versions of
Jackson components.

Result is this repo:

https://github.com/cowtowncoder/jackson-compat-minor

As per repo README, while Jackson has the usual semantic versioning
support for user code -- that is, user code that uses Jackson Public
API of specific version of M.m (where M is Major version, m is minor),
should work as-is with versions M.m+1, M.m+2 and so on.
But the same is NOT true between Jackson components themselves: they
(need to) use lower-level interfaces and are often more closely tied
to specific implementation, making it impractical to try to guarantee
similar compatibility between components.

As a result the only strong guarantee is that components of any patch
version of given minor release will work together -- but there are no
guarantees across minor versions.
So the best practice is to ensure that all Jackson components in use
will have the same minor versions (and for practical reason one might
as well use same patch version as well).

In practice, however, we try to retain as much backwards compatibility
as possible; and especially will try to keep stronger guarantees
between adjacent minor versions (like 2.8->2.9).

Now: type of compatibility depends, obviously, on direction of dependency.
Whereas `jackson-annotations` package does not depend on any other
Jackson component, many Jackson components depend on
`jackson-annotations`; and in such cases there are uni-directional
minimum guarantees: version 2.8 of `jackson-databind` requires at
least version 2.8 of `jackson-annotations` because it uses types
included within.
Similarly `jackson-databind` depending on `jackson-core` means that
version of latter has to be the same or later as version of former.

With this caveat it is generally true that one can usually use a newer
version of core components (annotations, streaming, databind) with
older versions of:

* dataformats (avro, cbor, csv, protobuf, properties, smile, xml, yaml)
* datatypes (joda, guava)

and this is what the repo tests.

Although I have not had much time to look into this, I thought I would
share two concrete findings:

* Jackson 2.9 core components appear to work with
     * 2.8.x and 2.7.x versions of dataformats, datatypes
     * Some components work with 2.6.x (specifically, smile/xml/yaml
dataformat 2.6.x DO NOT work with 2.9)
           - Specific reason for incompatibility is a
* Jackson 2.8 core components appear to have similar compatibility to
2.9 so that
     * 2.7.x versions of dataformats, datatypes work
     * Some but not all of 2.6.x work (smile/xml/yaml do not)

Anyway: while I do not recommend running systems with mixed minor
versions, it is still good that some of smaller differences do not
cause immediate problems.
And perhaps going forward we can try to both minimize disruptions and
document where versions incompatibilities occur.

-+ Tatu +-

-- 
You received this message because you are subscribed to the Google Groups 
"jackson-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to