Skip to content
f2prateek edited this page Apr 2, 2013 · 13 revisions

Running JDeodorant on our project gave us only one refactoring suggestion. This could have been due to the difference in the structure of our app (eclipse was showing lots of errors as well - likely due to missing libraries that we got from maven).

Some of the big refactoring we did :

  1. We made an AbstractRecipeActivity class. This class simply displays a recipe to the user. It's concrete implementations control whether the recipe is editable or simply viewable.
  2. Similarly we made an abstract RecipeGridFragment. It is re-used to display recipes from the network by NetworkGridFragment and recipes that are stored locally in LocalGridFragment.
  3. ImagepagerAdapter is now a super class that displays images in a view pager. It's subclass EditableImagePagerAdapter allows the user to add more images to the view pager.
  4. A util package that wraps logic used by multiple classes. Some of this includes BitmapUtils (to work with bitmaps).
  5. Abstract AsyncTasks are used extensively when model communicates with the view and controller. When the view request data from the model, the model returns a cached version and kicks of an async task to update the view. Extensions of this AsyncTask are also triggered when the controller updates the model, so views are automatically notified on new content, without writing any repeated code.

JDeodorant Type Arguments

Get rid of generic for make log tag method. We didn't do this change since we actually needed the function to work for any class - since it generates a tag for the class, not just PantryModel.

  • makeLogTag(Class cls) --> makeLogTag(Class cls)
Clone this wiki locally