Child classes and where to call them from
Posted: Tue Apr 24, 2007 9:13 pm
Let me preface by saying that I have no degree in programming, etc. But I am trying to develop my PHP skills, and I hope in the process, I don't dumb down this forum.
One of the things I try to do in my apps is build classes that serve only 1 purpose. So the end result is that I end up creating a bunch of child classes that extend my main class.
The problem I run into is I end up having functions in childclass1 that are needed by childclass2.
This may be a quite general question, but if a function in one child class is needed by a function in another child class, should I reconsider whether that function should be in the child class or the parent class?
One of the things I try to do in my apps is build classes that serve only 1 purpose. So the end result is that I end up creating a bunch of child classes that extend my main class.
The problem I run into is I end up having functions in childclass1 that are needed by childclass2.
This may be a quite general question, but if a function in one child class is needed by a function in another child class, should I reconsider whether that function should be in the child class or the parent class?