I have requirements for an Android application. The app already works for one client in V1.
- In V2 version of the app, we need the app to support 2 clients, for this we need to make changes in only 1 Activity/View class.
- This view class has some additional views which are different for client 2 and will have a separate new instance of a database - SharedPreferences.
- User can switch between 2 clients now (V1 had only one)
- With each switch, the view should change based on data and SharedPreferences of the client selected (shared preference has settings for each client mode).
Which is the best approach to:
Create a separate instance/view of ViewActivity and saving current state when switching
SharedPreference class - maintain another copy of this class with some additional fields or append new additional data fields for client 2 settings.
V1 app is already live and bug fixing in V1 is in process, we need to create V2 with backwards compatibility so that V1 users can upgrade to the V3 app seamlessly.
Please suggest what is the best approach I should use in creating V2 app considering the fact that more features (same or different) may be added for each client in future. We need to have an approach which makes the code easy to maintain and enhance.
P.S.: I'm new in designing software patterns and architecture, I may have missed something.