i’ll add my thoughts in the hope they may benefit someone and that i’ll get some feedback if i’m thinking looney.
major prinicple #1 - repeating code is not good. repeating code that may change in the future is bad. repeating code that will change in the future is reason to get your resume out - now! -lol-
i see a loose anology between OOP and database normalization. break the entity down to to its basic blocks. just like you can over normalize a database in some instances (or so i have read), you can probably over OOP in some cases, too.
in OOP you think in terms of the things some code does and then break it down to the unit level.
that doesn’t seem too hard, actually. once you envision that, then it is just a matter of learning the PHP OOP mechanics of getting all the small parts to work together.
if the OOPed to death (within reason, if the idea isn’t mutually exclusive) code is unacceptably slow, verify it is OOP that is causing this and decide if h/w can solve make the speed acceptable, if not very good for less than it will take you to un-OOP the code (and risk being wrong about the cause of the slowness). if the code is running nicely… you are living large.
also, think forward. assuming PHP’s OOP process isn’t optimized to an acceptable level right now, do you expect this to always be the case? do you want a ton of procedural (repeating code!) laying around in 2 years?
anyway, that’s my thought process. database normalization just makes sense. using PHP includes for repeating code (or functions) just makes sense. i think that OOP just makes sense as well.
i will have to learn the mechanics, though, and this thread is a great start. it can’t be nearly as hard as hacking css to work with all the top browsers! -lol-
having said that, i’m off to review my code to make updates!