Posted by Chad Johnson on 01/23/08 21:25
Suppose we're using an object-oriented framework for our web site.
We're obviously going to have a few common objects used throughout the
framework, such as User and DB (or just a DB connection link). How
would you go about making these objects available inside of the member
functions of your classes? Would you encapsulate them some common
object, like "Settings" or "Context"? Would you make these objects
available inside member functions via "global $VARIABLE_NAME;"? Pass
them individually or the Settings/Context object as a whole as a
constructor parameter for every object in your framework?
Surely someone else has faced this problem before...
[Back to original message]
|