in reply to Re: what is a propper way to make a chunk of data accessible to all my packages for retrieval and modification ?
in thread what is a propper way to make a chunk of data accessible to all my packages for retrieval and modification ?

How is that any different from global variables? The singleton’s class name is a global identifier.

(For more arguments other than those applicable to this particular use case, see Singleton Considered Stupid.)

Makeshifts last the longest.

  • Comment on Re^2: what is a propper way to make a chunk of data accessible to all my packages for retrieval and modification ?

Replies are listed 'Best First'.
Re^3: what is a propper way to make a chunk of data accessible to all my packages for retrieval and modification ?
by leocharre (Priest) on Feb 22, 2006 at 20:37 UTC

    What i read here in that link.. ominous.. Yeah im getting the feeling that i might as well use global variables then singleton objects.

    so, i still have these "master hashes" that i'd like to have my whole program access, want to add new modules as time goes by and no matter where the code is, i want to know that %::Garage will hold all the cars- and i have to do that by declaring our %Garage in main.

    am i going to coding hell?

    Please keep in mind im a poop virgin.

    i'm feeling like i've really missed something here with scoping and protecting symbol tables and even why- im thinking maybe i need to .. take a vacation. or play with static electricity close to the box fan.

    where can i read about ways around poop? about protecting the symbol table, why... any specific suggestions?

      I’d suggest writing configuration class and having the constructors of all your application classes take an instance of it.

      It depends on what you need to do with the data, though. Not all globals are evil.

      Makeshifts last the longest.

        So you're suggesting a singleton after all ? ;)