Linked by John Collins on Wed 21st Apr 2004 06:42 UTC
General Development The purpose of this article is to give a novice programmer the basic idea of what OOP is, as implemented using PHP. Readers should have a basic knowledge of programming ie what variables are, variable types, basic methods of writing comments, and how to enter code into a text editor.
Permalink for comment
To read all comments associated with this story, please click here.
@Luke McCarthy
by Lumbergh on Wed 21st Apr 2004 20:39 UTC

With a class you have reduced the reusability of all the functions ("methods") by locking them to a certain type of data structure. This may, in the short term, make them easier to use; but the lock-in nature dooms them to obscurity.


Right on, and this is not discussed enough. I know this is not really a problem with OOP - per se, and can be mitigated with refactoring, but this is a problem with re-use. Software artifacts should be loosely coupled with tight cohesion. When you throw everything in a class you end up with tight coupling a lot of the time.