Chris W. Parker wrote:
hi.

i've recently realized that the little "oo" code i've written is
actually not very oo at all. it's more like procedural code wrapped in a
class.

armed with my new knowledge i'm in the process of modifying my current
classes to be more oo (or what i like to this is more oo). so i'm going
to ask two questions and show two different examples stripped down to
their bare minimums as to not flood the list with code.

1. my question has to do with abstraction (i think that's the right
word).

Really, the best of OO programing is the code abstraction, and code re-use. You should make your classes that way, as you second example does.


With that on mind, you can change everything on yor classes without cnaging a single line of the code uses them. Just, you have to maintain the plublic methods used on your code, but this public functions have not to work the same way from one release to the next ...

Usualy try to do that when developing a class, and you will have nice results in the future. Some of my classes have almost nothing about the original class, but method names ... and that classes continue working with old code that uses the first release of the class.

If sometime in the future a method gets obsolete, what I do is maintain it for a while as a dummy method (which does nothing).

In my opinion, your classes will contain much code than a procedural design, but abstraction and reuse are much more usefull than short code.

Best regards,
Jordi.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to