I have an app where a model is attached to every activity. The model ask a repository for information that can come from server or local db depending on many factors. When it asks server for information it creates a petition encapsulated under an object that goes to a webService Manager that process the request. The webService manager returns and errorEvent if somethings goes wrong and also handles the errors. where there is information it returns a genericEvent that comes with all the information retrieved from the server.
The server is going to next rest api version, with some improvements and features. The server is an engine configurable from the app, since every client has it's own server setup. Some clients will not update their servers to new version, and use the version from playstore. So I need to be able to handle different versions of restApi from the app, since there will be endpoints missing on older versions of server.
My alternative for solutions
I've changed the Interface that is each repository, to a abstract class that extends this interface. in order to create common calls, that can be overridden under each version. So every new version will inherit from the previous one. with the necessary changes. This way I'll be able to handle changes.
NOTE: that is stated that endpoint that retrieves server configuration and version, won't change in time. Or at least in few years.
Any ideas about it?