• Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0
    • Fix Version/s: 2.5, 2.1
    • Component/s: None
    • Labels:


      Greg, hello:

      1) in this example you say:
      "Note that this example makes use of the global resource cache to store the loaded images."

      2) which reminds of the "java evil singleton pattern"
      and the consensus seems to be:
      "Singletons are fine as long as you don't implement them with static"

      3) and pivot uses them freely; few examples

      public abstract class ApplicationContext {

      protected static ArrayList<Display> displays = new ArrayList<Display>();
      protected static ArrayList<Application> applications = new ArrayList<Application>();

      private static HashMap<URI, Object> resourceCache = new HashMap<URI, Object>();
      private static ResourceCacheDictionary resourceCacheDictionary = new ResourceCacheDictionary();

      public abstract class Theme {

      private static Theme theme = null;

      4) do you think is it feasible to convert all of pivot into SPI:

      ServiceLoader<PivotFrameworkFactory> loader = ServiceLoader.load(PivotFrameworkFactory.class);
      PivotFrameworkFactory factory = loader.iterator().next();
      Map<String, Object> config = new HashMap<String, Object>();
      PivotFramework framework = factory.newFramework(config);

      5) the two use cases that affect me now:
      a) applet reload shares static
      b) pivot + osgi (not sure yet if I can find a workaround; possibly depends on what you do about PIVOT-742 PIVOT-22)

      thank you;



        Andrei Pozolotin created issue -
        Sandro Martini made changes -
        Field Original Value New Value
        Fix Version/s 2.1 [ 12314825 ]
        Affects Version/s 2.0 [ 12313780 ]
        Sandro Martini made changes -
        Assignee Sandro Martini [ smartini ]
        Sandro Martini made changes -
        Fix Version/s 2.1 [ 12324823 ]


          • Assignee:
            Sandro Martini
            Andrei Pozolotin
          • Votes:
            0 Vote for this issue
            1 Start watching this issue


            • Created: