in reply to Global or not global
(singleton = global variable)?
It is global state that is a problem, not just global variables. And yes, singletons are also global state. So you win nothing by using a singleton over a global variable.
So you have several options: you can understand why global state is bad, and still decide to use it. Or you can go the OO route where the database handle is available.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Global or not global
by tobyink (Canon) on Jul 03, 2012 at 10:14 UTC | |
|
Re^2: Global or not global
by BillKSmith (Monsignor) on Jul 30, 2012 at 02:41 UTC |