This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ServiceLocator { | |
// | |
// instance fields | |
// | |
private final static Map<Class, Object> _Services; | |
// | |
// constructors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// resolve system services | |
SharedPreferences sharedPreferences = context.getSharedPreferences( "Foodo", Context.MODE_PRIVATE ); | |
// create app services | |
LocationService locationService = new LocationService( context ); | |
AccountService accountService = new AccountService( sharedPreferences ); | |
ServiceLocator.registerLocationService( locationService ); | |
ServiceLocator.registerAccountService( accountService ); |