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
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