Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OOP Technique Advice

Status
Not open for further replies.

Itshim

Programmer
Apr 6, 2004
277
US
I wrote a recursion tree class which creates, and maintains data for trees (maintenance class). I am in the process of creating another class for retrieving data about the tree, and here is where my dilemma occurs. I would like to limit access to the db within these two classes. I envision the data retrieval class to be used by an interface class.

When interacting with the db, these classes access a db abstraction package which returns an object of a db result class. For the data retrieval class I really didn’t want to return the db result object to the interface class, so what I’ve done is roll up the results in a multidimensional array and return that array.
Example: $FirstRow=$result[0][‘Column_Name’]

My question is, is this a good idea; or should I simply return the object of the result class? (Does any of this make sense?)

Side Note: If anyone would like to see or use the maintenance class let me know, it is completely documented. Currently it uses a MySQL db abstraction class written by Harry Fuecks. Eventually I would like to change it to use the ADODB Library for support of different dbs, but as they say no project is ever done…

Any advice is appreciated.
Thanks,
Itshim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top