Thanks, Ben & Stefan,
I like the idea of using a global $cxn, but one counter-thought occurred to me: wouldn't using a global like that reduce portability?
If I share my Person class as a way to share my Person database,[1] using a global "$cxn" would force other users/developers to use "$cxn" as the variable for their Database instance, right? Passing the Database instance in when the Person instance is created[2] means any variable name can hold the Database object, so long as the Database instance is created from the specified Database class. Or, am I thinking backwards?
Also, Stefan, I would like to discuss inheritance more with you. In the context of my first footnote, many of the departments also track department-specific information that isn't needed or useful in a general demographics database. In cases like that, I'd like to be able to tell those departments that they can extend Person in order to also link to whatever department-specific information they need. (Er, I just realized that may mean having to pass two database connection objects... Must think about that.) If I do build Person as a base class, future versions can only add functions, not subtract, right? And, while code inside the functions can change, the returned output needs to be consistent, version over version. What else do I need to think about? (Finally, should this inheritance discussion get its own thread?)
Thanks, again!
dafydd
[1] - The organization to which I'm contributing doesn't have good departmental access to the main volunteer database. So, departments with larger staffing needs are building their own applications, and volunteers are having to submit their demographic information to the org in general ~and~ each department with which they work. If my after-hours coding gets adopted, I reduce that inefficiency.
[2] - I hate the word "instantiate." "Create an instance of" is too hard to express?