Thread: singleton and other designs

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User kroiz's Avatar
    Join Date
    Jun 2007
    Posts
    116
    Singleton is the Design Pattern that is over used the most.

  2. #2
    semi-colon generator ChaosEngine's Avatar
    Join Date
    Sep 2005
    Location
    Chch, NZ
    Posts
    597
    why do you need an "Options" class at all? Such a class has low coherence (it contains data relating to many functional areas) and high coupling (it introduces a dependency between unrelated areas). Both of these are Bad Things (tm).

    Why not simply allow the "option" to reside wherever it is most relevant?
    "I saw a sign that said 'Drink Canada Dry', so I started"
    -- Brendan Behan

    Free Compiler: Visual C++ 2005 Express
    If you program in C++, you need Boost. You should also know how to use the Standard Library (STL). Want to make games? After reading this, I don't like WxWidgets anymore. Want to add some scripting to your App?

  3. #3
    Registered User
    Join Date
    May 2006
    Posts
    630
    Quote Originally Posted by ChaosEngine View Post
    Why not simply allow the "option" to reside wherever it is most relevant?
    I wanted to keep all options that are being read from a file (user) in a special class (for instance class user_options).

    I havent thought that might be a bad idea..

    So you're saying it would be better to just copy options to class, where they're needed?
    In this case I would have to store references to all classes that need particular options and then copy them where they belong to..

    Is this a good approach?

Popular pages Recent additions subscribe to a feed