Announcement Announcement Module
Collapse
No announcement yet.
Decision to use the Spring Framework Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #61
    Originally posted by madtree
    Alright how do you pass the object to the load method if you can't construct it?
    static(ness!) need more hint?

    I was speaking about Singletons not service locator. Don't put words in my mouth. Look again I never mentionned service locators. Anyway this discussion is going nowhere so I'm done.
    yes but you did described service locator for your arguments against singleton. the article you pointed to was all about DI V/S service locator. Like you said Factories will solve duplication, and 9 out of 10 times I have seen people use singleton to implement factory.


    Let me give you a wrong reason if that explains more. A singleton initialize a hashmap to store a list of countries or list of state is bad (just a simple example though).
    Last edited by tatvamasi; Sep 18th, 2006, 11:39 AM.

    Comment


    • #62
      Originally posted by madtree
      That's a clear reason! Let's be adult and finish this discussion here.
      clear reason to what? That was a legit answer I gave you, You said give me a good place to put singleton that you already answered with your factory and repository answer. I just pointed that out. Also, Loading up Configuration once is another example.

      Comment


      • #63
        Originally posted by tatvamasi
        static(ness!) need more hint?
        Have you red the article? I don't think so...

        Originally posted by fowler
        class ServiceLocator
        ...
        public static void load(ServiceLocator arg) {
        soleInstance = arg;
        }

        public ServiceLocator(MovieFinder movieFinder) {
        this.movieFinder = movieFinder;
        }

        Comment

        Working...
        X