Do you have a question? Post it now! No Registration Necessary. Now with pictures!
August 11, 2004, 1:45 pm
rate this thread
MyInterface customers = new MySpecificClass();
The idea is that if later one wants to change the specific
implementation one only has to change a few lines, possibly just the
one line above. Thus the code becomes more flexible.
Is it right to say that there is no way to do this in PHP? I've taken
to simulating the same by using one object as a mask that sets and
then uses another object:
myMaskObj = new MaskDatabase();
myMaskObj->query("SELECT * FROM content WHERE type='comments'");
MaskDatabase has a method called "query" which simply passes the query
along to DatabaseObject which also has a method called query.