The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages - More
> Software Design
|
OO Programming in PHP
Discuss OO Programming in PHP in the Software Design forum on Dev Shed. OO Programming in PHP Software design forum discussing design principles and non-language specific algorithms. Get help with logic, algebraic, or relational concepts.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

April 7th, 2010, 10: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, 06:50 AM
|
|
Contributing User
|
|
Join Date: Jan 2009
Posts: 34
Time spent in forums: 14 h 12 m 28 sec
Reputation Power: 5
|
|
|
Book Recommendation
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, 01:38 AM
|
 |
Code Monkey V. 0.9
|
|
Join Date: Mar 2005
Location: A Land Down Under
|
|
|
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 Vehicle
var power
var num_wheels
var num_doors
class Car extends Vehicle
var brand
var model
class Motorcyle extends Vehicle
var brand
class Convertible extends Car
var roof_down
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, 12:13 PM
|
|
|
Quote: | Originally Posted by Catacaustic 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 Vehicle
var power
var num_wheels
var num_doors
class Car extends Vehicle
var brand
var model
class Motorcyle extends Vehicle
var brand
class Convertible extends Car
var roof_down
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. |
Yeah I'm past this level already. I use inheritance and abstraction but that's about it.
|

May 19th, 2010, 06:23 AM
|
|
Registered User
|
|
Join Date: May 2010
Posts: 12
Time spent in forums: 3 h 22 m 58 sec
Reputation Power: 0
|
|
|
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, 02:05 PM
|
|
Registered User
|
|
Join Date: Aug 2010
Posts: 8

Time spent in forums: 2 h 11 m 49 sec
Reputation Power: 0
|
|
Quote: | Originally Posted by JulianRead101 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. |
I've just started reading this, so far so good.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|