Announcement Announcement Module
Collapse
No announcement yet.
Definition of Spring "singleton"? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Hi, Costin.

    I understand, but in the world of day-to-day java app development, the per-classloader singleton is pretty useless, wouldn't you say?

    I mean, google up "java singleton pattern", and notice how the classloader issue is "deceptive", and a "pitfall". It is something to be worked-around, not a desired feature of the conceptual pattern. Example:

    http://www.javaworld.com/javaworld/j...npatterns.html

    Other authors (from the google) talk about the threading problem that one has to work around and the cloning problem that has to be worked around, but interestingly, not the classloader problem (maybe coz there is no reasonable work-around?) :

    http://www.javacoffeebreak.com/artic...rns/index.html

    Other authors don't even mention ANY problems, saying only that it's "simple":

    http://www.onjava.com/pub/a/onjava/2...singleton.html

    IMHO, what day-to-day app programmers are usually looking for are frameworks like Spring, which abstract away some of the "deceptive"s and the "pitfall"s of java, so they're free to concentrate on the higher-level patterns, patterns (like the 4 stated above) which would allow them to quickly and reliably write their application-level code.

    Ben

    Comment


    • #17
      I'm not arguing about the usefulness of the singleton pattern; I'm just trying to clarify this .

      Comment


      • #18
        I understand. Thanks.

        Ben

        Comment

        Working...
        X