Results 1 to 9 of 9
  1. #1
    haiforhussain is offline Member
    Join Date
    Jun 2008
    Posts
    11
    Rep Power
    0

    Default singleton object ...

    can anyone explain about singleton object and its use ....

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    It's all about a design pattern. I think it's better to find a article and read. Just Google it, you have a large number of such.

  3. #3
    sukatoa's Avatar
    sukatoa is offline Senior Member
    Join Date
    Jan 2008
    Location
    Cebu City, Philippines
    Posts
    556
    Rep Power
    7

    Default

    Read this article...
    freedom exists in the world of ideas

  4. #4
    fishtoprecords's Avatar
    fishtoprecords is offline Senior Member
    Join Date
    Jun 2008
    Posts
    571
    Rep Power
    6

    Default

    Quote Originally Posted by haiforhussain View Post
    can anyone explain about singleton object and its use ....
    Once you've read what it is, please search google for all the reasons you should not use it.
    Such as "Singleton Considered Stupid "

    And check into the JUnit groups and see how using Singletons makes proper unit testing much harder.

    In general, a Singleton is just a wad of global stuff. Good OO design avoids global stuff, as it increases coupling.

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Quote Originally Posted by fishtoprecords View Post
    In general, a Singleton is just a wad of global stuff. Good OO design avoids global stuff, as it increases coupling.
    I agreed with you. So all this about encapsulations.

  6. #6
    fishtoprecords's Avatar
    fishtoprecords is offline Senior Member
    Join Date
    Jun 2008
    Posts
    571
    Rep Power
    6

    Default

    Yes, good OO should be about abstractions and isolation. Coupling has been proven to make systems exponentially complex.

    Sadly, a lot of Java, even professionally developed Java is not very good OO.
    This bad Java will be the Year 2000 Cobol problem of the future, probably in five years or so.

  7. #7
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Lots of people working on Java(other languages too) without knowing any about OO. Some people don't want to use it either. I don't know why, but in later they found full wired with further maintainability and expandability of the application.

  8. #8
    fishtoprecords's Avatar
    fishtoprecords is offline Senior Member
    Join Date
    Jun 2008
    Posts
    571
    Rep Power
    6

    Default

    I think part of it is that Java was cursed with a C-foundation, which greatly helped acceptance at first, but enables bad practices.

    I did some professional Smalltalk, and while it wasn't long term useful (Smalltalk is dead) it forced you to think about OO seriously.

    For a lot of applications, especially in the business domain, OO hasn't worked well. It works great for GUIs and other user interfaces, but gets hard to do with a payroll record.

    Our continued use of Relational DBMS doesn't help.

    This is probably moving a bit OT, probably should go into a less specific thread.


    Quote Originally Posted by Eranga View Post
    they found full wired with further maintainability and expandability of the application.
    I'm not quite following this, perhaps its an idiom? or maybe typo? What is "fully wired" in this context? Thanks Pat

  9. #9
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

Similar Threads

  1. Replies: 0
    Last Post: 03-29-2008, 12:41 PM
  2. Singleton Pattern
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-24-2008, 03:21 PM
  3. Replies: 0
    Last Post: 09-26-2007, 08:32 PM
  4. Google Singleton Detector 0.7.2
    By levent in forum Java Software
    Replies: 0
    Last Post: 07-26-2007, 08:12 PM
  5. singleton pattern
    By Peter in forum Advanced Java
    Replies: 1
    Last Post: 07-09-2007, 04:45 AM

Posting Permissions

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