This discussion is archived
13 Replies Latest reply: Nov 17, 2010 2:01 PM by jschellSomeoneStoleMyAlias RSS

Singleton

269490 Newbie
Currently Being Moderated
What is the main reason for using a singleton?
  • 1. Re: Singleton
    796440 Guru
    Currently Being Moderated
    ttb999 wrote:
    What is the main reason for using a singleton?
    Is google broken?

    And this question has nothing to do with Java.
  • 2. Re: Singleton
    269490 Newbie
    Currently Being Moderated
    jverd wrote:
    ttb999 wrote:
    What is the main reason for using a singleton?
    Is google broken?

    And this question has nothing to do with Java.
    Isn't it a pattern? Is this a Java forum?

    Edited by: ttb999 on 15-Nov-2010 1:06 PM
  • 3. Re: Singleton
    796440 Guru
    Currently Being Moderated
    ttb999 wrote:
    jverd wrote:
    ttb999 wrote:
    What is the main reason for using a singleton?
    Is google broken?

    And this question has nothing to do with Java.
    Isn't it a pattern?
    Yes. It's a pattern that is independent of programming language. And for such a general question, there's plenty of information available with a simple web search.
    Is this a Java forum?
    I would think that it's obvious that this is a Java forum. Your question, however, has nothing to do with Java.
  • 4. Re: Singleton
    269490 Newbie
    Currently Being Moderated
    jverd wrote:
    ttb999 wrote:
    jverd wrote:
    ttb999 wrote:
    What is the main reason for using a singleton?
    Is google broken?

    And this question has nothing to do with Java.
    Isn't it a pattern?
    Yes. It's a pattern that is independent of programming language. And for such a general question, there's plenty of information available with a simple web search.
    Is this a Java forum?
    I would think that it's obvious that this is a Java forum. Your question, however, has nothing to do with Java.
    I would think that it is obvious that it is not specifically a Java forum since there is no mention of Java anywhere in the forum name.
    That being said, I have googled and there is a lot of controversy regarding the use of Singletons. That is why I asked.
    You know, if you don't want to answer the question, there is no rule saying you have to.
  • 5. Re: Singleton
    269490 Newbie
    Currently Being Moderated
    jverd wrote:
    ttb999 wrote:
    jverd wrote:
    ttb999 wrote:
    What is the main reason for using a singleton?
    Is google broken?

    And this question has nothing to do with Java.
    Isn't it a pattern?
    Yes. It's a pattern that is independent of programming language. And for such a general question, there's plenty of information available with a simple web search.
    Is this a Java forum?
    I would think that it's obvious that this is a Java forum. Your question, however, has nothing to do with Java.
    Please see

    Forum Home » Java Essentials » Java Programming
  • 6. Re: Singleton
    796440 Guru
    Currently Being Moderated
    What about it? What point are you trying to make?

    Everything I've said so far still stands.
  • 7. Re: Singleton
    269490 Newbie
    Currently Being Moderated
    jverd wrote:
    What about it? What point are you trying to make?

    Everything I've said so far still stands.
    My point is that you belief that this is a Java forum is your belief only and has no factual basis whatsoever.
    That, in addition to the fact that this is also, as stated in the title, a patterns forum makes everything you've said basically wrong.
  • 8. Re: Singleton
    796440 Guru
    Currently Being Moderated
    ttb999 wrote:
    jverd wrote:
    What about it? What point are you trying to make?

    Everything I've said so far still stands.
    My point is that you belief that this is a Java forum is your belief only and has no factual basis whatsoever.
    Um, no, this is specifically a Java forum. The breadcrumbs at the top make it look otherwise, but if you go to http://forums.oracle.com, and look under Java for Other Topics, expand that, you'll see Patterns and OO Design. So, yes, this is a forum for Patterns and OO Design in Java.

    Or, alternatively, go to http://forums.oracle.com/forums/category.jspa?categoryID=285, and notice that at the top it says, "Category: Java", and as a subsection of that we have Patterns and OO Design.
    That, in addition to the fact that this is also, as stated in the title, a patterns forum makes everything you've said basically wrong.
    Wrong. You just didn't pay enough attention when you navigated here in the first place. Though I could see how you might never have seen the word Java, depending on what path you cam in by. There are definitely some kinks to still be worked out since these Java forums migrated here when Oracle bought Sun.

    Edited by: jverd on Nov 15, 2010 3:04 PM
  • 9. Re: Singleton
    796440 Guru
    Currently Being Moderated
    ttb999 wrote:
    That being said, I have googled and there is a lot of controversy regarding the use of Singletons. That is why I asked.
    So, by reading "What's the main use of singleton", we're supposed to know that you googled, what you read, what controversy you encountered, and what confusion it caused you, and somehow whatever some strangers says on this website will be more authoritative than the other various comments from other strangers on other websites? And this seems like a rational approach to you?
    You know, if you don't want to answer the question, there is no rule saying you have to.
    There's also no rule that says that I can't point out the flaws in your question, hoping that you might learn from them and ask a clearer, more meaningful question.
  • 10. Re: Singleton
    269490 Newbie
    Currently Being Moderated
    jverd wrote:
    ttb999 wrote:
    That being said, I have googled and there is a lot of controversy regarding the use of Singletons. That is why I asked.
    So, by reading "What's the main use of singleton", we're supposed to know that you googled, what you read, what controversy you encountered, and what confusion it caused you, and somehow whatever some strangers says on this website will be more authoritative than the other various comments from other strangers on other websites? And this seems like a rational approach to you?
    I didn't say it was more or less authoritative. Posing the question here and replying to the answer would be interactive. I can't really discuss the topic or ask questions if what I read elsewhere was 2 years old.
    You see, some thought actually went into why I would ask a question here.

    >
    You know, if you don't want to answer the question, there is no rule saying you have to.
    There's also no rule that says that I can't point out the flaws in your question, hoping that you might learn from them and ask a clearer, more meaningful question.
    Yes, but it is best to only answer if you are answering correctly instead of posing arguments that are false.
  • 11. Re: Singleton
    796440 Guru
    Currently Being Moderated
    ttb999 wrote:
    jverd wrote:
    ttb999 wrote:
    That being said, I have googled and there is a lot of controversy regarding the use of Singletons. That is why I asked.
    So, by reading "What's the main use of singleton", we're supposed to know that you googled, what you read, what controversy you encountered, and what confusion it caused you, and somehow whatever some strangers says on this website will be more authoritative than the other various comments from other strangers on other websites? And this seems like a rational approach to you?
    I didn't say it was more or less authoritative. Posing the question here and replying to the answer would be interactive. I can't really discuss the topic or ask questions if what I read elsewhere was 2 years old.
    The uses for Singleton haven't really changed in at least the dozen or so years since I first read about it.
    You see, some thought actually went into why I would ask a question here.
    But none into actually posting the question.
    You know, if you don't want to answer the question, there is no rule saying you have to.
    There's also no rule that says that I can't point out the flaws in your question, hoping that you might learn from them and ask a clearer, more meaningful question.
    Yes, but it is best to only answer if you are answering correctly instead of posing arguments that are false.
    Nothing I posted was false, except perhaps when I suggested that is should be obvious that this is a Java forum. I'd forgotten about the misleading breadcrumbs, so, yeah, I can see how the fact that this is a Java forum might not be obvious.

    The rest of my comments still hold. Even if you'd posted in an appropriate forum, your question as phrased is still inane.
  • 12. Re: Singleton
    jschellSomeoneStoleMyAlias Expert
    Currently Being Moderated
    ttb999 wrote:
    jverd wrote:
    What about it? What point are you trying to make?

    Everything I've said so far still stands.
    My point is that you belief that this is a Java forum is your belief only and has no factual basis whatsoever.
    That, in addition to the fact that this is also, as stated in the title, a patterns forum makes everything you've said basically wrong.
    You are wrong. There is a hierarchy to the forums and this one exists under java.

    And if it isn't a java forum then in the context of programming languages, which is the only context appropriate for Singleton, the only other language on this site is PL/SQL and singleton doesn't apply to that.
  • 13. Re: Singleton
    jschellSomeoneStoleMyAlias Expert
    Currently Being Moderated
    ttb999 wrote:
    That being said, I have googled and there is a lot of controversy regarding the use of Singletons.
    Which you did not state in your original question.

    The definitions of Singleton which you can google explain the rational behind why you would use it.

    The only controversies are:
    1. Implementation details. Which do not fit into your question.
    2. Overuse and misunderstanding OO in general leads to abuse which means many people suggest not using it at all.

    And neither of those have anything to do with your original question.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points