I agree with jordan in that he can localise the DB connection
For example I like to create an instance of a DB object that handles the SQL connection this in turn can handle a generic mySQL query and return the results.
I can then pass the instaniated object reference as an argument to another instance of something else I need, giving the new object control of the database.
This enables me to localise values and encapasulate common routines.
myCart = new Ecom(new DB());
pageLayout = new Page(new DB());
etc
I dont know if anybody else agree`s or not? but I believe because of the way PHP functions and MySql cohabits, I cant see true OOP akin to Java being in widespread use, I find within PHP it can actually be as much of a hinderance aswell a saviour
So regarding OOP and linear programming, I guess its just a question of the right tool for the right job...at the right time.. I just use what`s needed


LinkBack URL
About LinkBacks




Reply With Quote

Bookmarks
Algorithms and Data Structures
Java tutorials
Algorithms Forum