Map-A-Droid / MAD

Map PoGo stuff with Android devices
212 stars 132 forks source link

Refactoring thoughts #587

Open DrMurx opened 4 years ago

DrMurx commented 4 years ago

This is a meta-issue on all the "little" issues I found worth refactoring in the current code base which are too big to be done along the way.

Anti-patterns or unexpected code style

Certain patterns in the code make it harder to understand, and prevent or impede the creation of proper tests. Try to be as DRY (Don't Repeat Yourself) as possible.

Big do-it-all classes/methods

Big classes and methods are bad for readability, make the code hard to understand for new developers and prevent proper testing. They should be broken down into smaller units with a well designed and documented interface that only exposes the methods needed. Wherever possible, use the composition pattern instead of inheritance.

Group data together & avoid redundancy

Data that belong together should stay together.

Expl0dingBanana commented 4 years ago

In terms of geospatial calculations, the DB rework was moving some of the code into the resource class from the data_manager (2ce7aff). I have not moved geofence_helper yet but its on the todo list. This will also make it easier to add geojson support.