In my app, which has tabbled activity with four tabs [ tab1 | tab2 | tab3 | tab4 ]. Pic shown is not of my app, but to get a feel how it might look similar to although there are differences as mentioned here.
- Each tab is associated with a fragment. Each fragment is list, either in vertical list or grid.
- Tab1 and Tab2 has list of similar objects(X), restaurants.
- Tab3 has different class object list (Y), friends.
- Tab4 has object list and each object is superset of object(X) + object (Y). Restaurants and my friends who visited there.
- Each of these tab content are different and obtained through RESTful http call.
Now, my query is:
- Should I put all view class, X, Y, X+Y in factory pattern?
- Should I put REST api call into observer pattern with callback on data receive?
Am I correct with this approach or should I chose different pattern to make things even improved?
Aucun commentaire:
Enregistrer un commentaire