vendredi 6 novembre 2015

Android Context getSystemService: a map's awkward global state

Commonly, apps override getSystemService in some Context object and use the call to the Android system service map to obtain references to objects held by some Context object. This tends to mean that the Context object is injected everywhere and then getSystemService is called on it. Why not just inject the object that is needed? Or, inject one's own bundle or map?

Aucun commentaire:

Enregistrer un commentaire