Refactoring Notes - CMPUT301F14T06/Team06MapleSyrup GitHub Wiki
Refactoring which has been applied:
Refactor MainActivity (By hand):
Before refactoring, we have 4 individual activities for main question list, local question list, favorite question list, and my question list. Their code appears extreme similar to each other, and the switch between activities make the app very slow. So we give up the original structure; instead, we modified these activities to 4 fragments of the MainActivity. Thus, the switch between different user interfaces is faster than before. Also, the similar methods can be referenced from the MainActivity, so the code redundancy is reduced.
Refactoring which has NOT been applied:
Refactor CreateQuestionActivity's showDialog and showSelectedDialog method (By JDeodorant)
In CreateQuestionActivity, JDeodorant suggest that I should Refactor these two methods and related local variable to a new method, but after I run the JDeodorant the new method is just the same of the orginal method, and the size is also close. This is not a reasonable Refactor.
Refactor FragmentMain,MyLocalActivity,MyQuestionActivity,MyFavoriteActivity,WaitingListActivity's mListView (By JDeodorant/hand)
In FragmentMain,MyLocalActivity,MyQuestionActivity,MyFavoriteActivity,WaitingListActivity, they all have mListView and its listener which are very similar, At first I run the JDeodorant, but what it did is just create a new class which put all related lines to the class. if I decide to apply this refactor, there'll be 4 new classes and they are still similar. So I try to refactor by hand, but they have different view id as they are not in the same layout, it may not be a good idea to refactor these methods, so I didn't refactor it at last.