Page 7 of 7 FirstFirst ... 567
Results 61 to 63 of 63

Thread: Decision to use the Spring Framework

  1. #61

    Default

    Quote 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 at 11:39 AM.

  2. #62

    Default

    Quote 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.

  3. #63

    Default

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

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

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •