cmisrmdamwcm
Versioning is a fun topic. Here is how I think about it. There are 3 types of versions and each is managed differently.
I would have included that under API version, since it is a breaking change to the entire API.
However if you use the authorization header or any header really for this stuff you can allow all kinds of methods without breaking the API. You would only need to version if you put the auth somewhere in the body.
I have a current client that has been using the same "base" API for
more than seven years and has evolved their offerings quite a bit over
that time and we've never had to add version numbers to the API URIs
and have not had problems "breaking" any existing clients in all that
time.
yes, the front-end *app* has undergone version numbers (this is
marketing versioning, tho), but the application interface has not.
yes, our URIs change when needed, but this is not a "version change",
this is a "resource change"
yes, *sometimes* a digit shows up in a URI, but there is no "version
management" invovled here, it's just a new resource URI
yes, we often make minor modifications to a response representations
for and existing URI (add elements, for example) but they are done so
that existing clients are not adversely affected.
I have a client w/ a library of more than 600 "API" resources which
they use to create multiple "applications" for hundreds of enterprise
clients serving thousands of users. They have dozens of "third-party"
client applications (usually internal apps built by partners or
"first-level" clients) anf they have no problem working w/ us or
maintaining their existing code when we make changes to the libraries.
I just don't version.
mca
http://amundsen.com/blog/
http://twitter.com@mamund
http://mamund.com/foaf.rdf#me
--
Mike
http://twitter.com/mikekelly85
http://github.com/mikekelly
http://linkedin.com/in/mikekelly123
IME, it turns out quite a few of the minor changes can be handled by #1, too.
mca
http://amundsen.com/blog/
http://twitter.com@mamund
http://mamund.com/foaf.rdf#me
mca
http://amundsen.com/blog/
http://twitter.com@mamund
http://mamund.com/foaf.rdf#me
the identifiers (usually @rel, sometimes something else) are usually
stable, even when the resource evolves. this sometimes happen even if
the URI changes (esp. for web browser cases where the bindings are in
JS that is also provided by the same origin).
in this implementation, a multi-tenant approach is used. each customer
has a unique URI namespace (via DNS - customer1.myapp.com). in that
case, some of the resources are "customized" based on the DNS. for
eample, the rel="invoice" for customer1.myapp.com might return a
representation that is an "incompatible extension" of the
rel="invoice" representation of customer2.myapp.com. in this case,
it's a diff URI in the path between customer1 and customer2
not sure if that helps/answers your Q, sorry.
mca
http://amundsen.com/blog/
http://twitter.com@mamund
http://mamund.com/foaf.rdf#me
> Ok, I second this approach - but how is this not versioning?
There's an important difference, here, between designing an API that will be served by only one server, and designing an API that will be implemented by many independent parties.
If there is only one instance, then we can be confident that all changes seen by the client evolve monotonically. That is, under the change doctrine just mentioned, if a client connects at time "A" and sees that the result includes field "X", then the client can be confident that a connection at time "B" (later than "A") will also include "X". Maybe some other stuff too, but definitely "X".
However, if many implementations of the API will exist (as for example with an API that becomes a standard), they may not all update at the same time. So, when a client connects at "A" and sees "X", there's no assurance at time "B" that "X" will still be there -- if the connections at "A" and "B" are to different implementations. It's possible that the server connected to at time "B" implements an earlier version of the API, one before the invention of "X".
In a way, we can say that time itself is the versioning system in the first case, but that it's insufficient in the second. If you're doing the second case, you may have to be more rigorous and explicit about your versioning.
To answer the quoted question: in a first-case (single implementation) world, a certain class of changes is "backwards-compatible," and we don't need any overt versioning to handle it. But in the second case (multiple implementations), even these changes require overt versioning.
Jack Repenning
My problem here is that this is still versioning, it's just a strategy
that keeps explicit version changes to a minimum but doesn't eliminate
them completely. Referring to it as 'not versioning' is confusing and
misleading. That does not mean it is not a good strategy for m2m
applications.
Cheers,
Mike
> My problem here is that this is still versioning, it's just a strategy
> that keeps explicit version changes to a minimum but doesn't eliminate
> them completely. Referring to it as 'not versioning' is confusing and
> misleading.
Hmmm ... how about "(not) making the versioning explicit in the URL and/or media"?
Jack Repenning