[
https://issues.apache.org/jira/browse/DMAP-55?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Reza Naghibi resolved DMAP-55.
------------------------------
Resolution: Fixed
Fix Version/s: 1.1.0 Java
> Resolve twisting of Singleton and Factory in DeviceMapFactory
> -------------------------------------------------------------
>
> Key: DMAP-55
> URL: https://issues.apache.org/jira/browse/DMAP-55
> Project: DeviceMap
> Issue Type: Bug
> Components: Java API
> Reporter: Werner Keil
> Assignee: Reza Naghibi
> Fix For: 1.1.0 Java
>
>
> 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.
--
This message was sent by Atlassian JIRA
(v6.2#6252)