Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualSquared'D

Posted 09 May 2013 - 02:07 AM

I USED TO use a lot of global variables and singletons in my code until I started expanding my functionality and noticed that many things that I thought that I had only needed one of, I actually needed more. Even some "managers" and "systems" worked better and was more intuitive with more than one instance. Sometimes this was because of resource or system lifetimes and some other reasons that I can't think of. (I'm typing this on my phone while eating dinner. ) I found that passing references to managers and factories, as well as having some resources keep a pointer to their managers made things much nicer. Globals and singletons looked nice at first but in the end it made things more difficult. Later when I'm on my computer, I may post some examples. (If I remember)

#2Squared'D

Posted 08 May 2013 - 06:07 PM

I USED TO use a lot of global variables and singletons in my code until I started expanding my functionality and noticed that many things that I thought that I had only needed one of, I actually needed more. Even some "managers" and "systems" worked better and was more intuitive with more than one instance. Sometimes this was because of resource or system lifetimes and some other reasons that I can't think of. (I'm typing this on my phone while eating dinner. ) I found that passing references to managers and factories, as well as having some resources keep a pointer to their managers made the could much nicer. Globals and singletons looked nice at first but in the end it made things more difficult. Later when I'm on my computer, I may post some examples. (If I remember)

#1Squared'D

Posted 08 May 2013 - 03:36 AM

I USED TO use a lot of global variables and singletons in my code until I started expanding my functionality and noticed that many things that I thought that I had only needed on of, I actually needed more. Even some "managers" and "systems" worked better and was more intuitive with more than one instance. Sometimes this was because of resource or system lifetimes and some other reasons that I can't think of. (I'm typing this on my phone while eating dinner. ) I found that passing references to managers and factories, as well as having some resources keep a pointer to their managers made the could much nicer. Globals and singletons looked nice at first but in the end it made things more difficult. Later when I'm on my computer, I may post some examples. (If I remember)

PARTNERS