lonelyplanet/lpm-testapp-android — pull request #1 by TimeSlides (2014-04-21 20:26:15+00:00)
Title: Refactor code for LP test app

- The classes were all in one file. I split them out.
- The layout used by the list adapter was unnecessarily deep. I flattened it.
- The Database was using hard-coded values. I pulled them out to statics and exposed so that
callers can ensure they are using the proper values.
- I removed setters from the Place() object as it seems like the class should be Immutable
- removed default Place() constructor to tighten up contract
- Made the app use the values from the database if they are available
- Tried to standardize the variable naming conventions across the app
- There was no view recycling happening in the adapter. I added that.
- I also added a ViewHolder to the adapter
- The androidManifest was not declaring the tag. I added it.
- There were places where ArrayList was being used when it seemed better practice to use List

Notes:

There were some things that seemed a bit ambiguous. For instance:

- It would be best practice to have the (simulated) network
call handled by a service, but that seemed like overkill for this test app.

- It was a bit ambiguous over whether or not Place objects actually have a "place id" concept
distinct from their database id. I think maybe this was supposed to be an example of coupling the
database too closely to the data model, but I was unsure. That id isn't used in the test app so I
just left it untouched.