Uploaded image for project: 'DeviceMap'
  1. DeviceMap
  2. DMAP-55

Resolve twisting of Singleton and Factory in DeviceMapFactory

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.1.0 Java
    • Java Client
    • 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.

      Attachments

        Activity

          People

            rezan Reza Naghibi
            keilw Werner Keil
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: