April 7th, 2010, 11:05 PM
OO Programming in PHP
Hey everyone. In the company I currently work for I've developed a CMS in php with a lot of ajax for the front end stuff. On the backend I have an abstract parent class that has the common functionality for all the modules. Besides the general idea of using inheritance, abstraction, and generally making and using objects I don't think I know much else about using OO programming in real world situations. All the tutorials I've been able to find don't have good real world examples so I'm hoping someone can point me down a path to increase my OO programing skills, preferably in PHP.
April 13th, 2010, 07:50 AM
I would recommend getting the following book "Head First Design Patterns", I am in the middle of reading it and so far I am impressed.
It is not PHP specific but it is very good at explaining soloutions to common design problems and has helped me in communicating with other developers.
April 16th, 2010, 02:38 AM
The closest thing to a "real world" example to something like that I can think of quickly, is cars. I'll tyr to make this not PHP-specific, as pretyt much eveyr OO language does the same things.
class Car extends Vehicle
class Motorcyle extends Vehicle
class Convertible extends Car
That's the basic idea. Start with a base class, and build things on top as they get more diverse. When it does, inherit/extend (terminology can differe depending on languages) from the class next back in the tree and keep going from there.
April 17th, 2010, 01:13 PM
Yeah I'm past this level already. I use inheritance and abstraction but that's about it.
Originally Posted by Catacaustic
OO PHP is really more important factor that stands out are productivity, organization, and efficiency.Thse all the things are realy become effective by using OO in PHP and it can save time or increase workflow. For organization, OO PHP can keep your code and files organized. By efficiency, OO PHP can make your project and future projects run smoothly.
August 31st, 2010, 03:05 PM
I've just started reading this, so far so good.
Originally Posted by JulianRead101