Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
There's an irritating mix-up between a factory pattern and singleton commonly applied via getInstance(), valueOf() or similar.
LocationProvider myLocationProvider = LocationProvider.getInstance(myCriteria);
Location myLocation = myLocationProvider.getLocation(300);
see http://stackoverflow.com/questions/10477281/please-tell-me-when-to-use-getinstance-method-in-java
In DeviceMapFactory getInstance() returns a DeviceMapClient() which is confusing/wrong, it should return an instance of DeviceMapFactory.
If the factory's static method is not meant to return itself, then please rename it to getClient() or similar, see above.