I'm developing a client-server application and can't force users not to use older versions of client, or even other clients, since the protocol is WebDAV.
What I need is to support all of them, with some kind of backward compatibility, so that server side will behave different way, depending on what client version it is working with.
My question is how to prepare my application to this situation, before facing it. Do I need to use some design pattern? How to design backward compatibility?
If you create a proper API (Facade design pattern) for your server, you'd make your life easier in the future.
suppose your server provides an API that consists of services A, B & C. These services are implemented in the business logic layer. access to these services from the clients is always through the facade, no direct access. so your facade (version 1) exposes A, B & C. no big deal so far...
now suppose you need to add service D, remove service B, and change service C. you create a new facade (version 2), which exposes services A, D and an updated C. in your business layer you would add the logic for service D, mark B as "obsolete", and as for the change in C, it depends if the change is backward compatible. if yes it's easy, just add an overload. if service C now works completely different, implement it as a new service. sometimes though there are changes that break old clients...
the Facade itself could be a web service (my preferred solution in most cases), and has no business logic of it's own, its only responsibility is to delegate the call from the client to the approproate service.