PHP OO programming references? Sep22 '05

Feedback

# (1 of 3): Jennifer Grucza » jennifergrucza.com

1 hour, 2 minutes after the fact. (Thu 22 Sep 2005, 12:16 PM CST)

They really compare programming to a microwave or bicycle? Or are they just using microwaves and bicycles as examples of objects, and you want something a little more real-life? (Like here's a Post object. A Post includes information such as Author, Date, and Content. There are also Category objects. A Category has a name and a collection of Posts. There are methods on Category like addPost(), deleteAllPosts(), etc. And so on...)

Converting existing code shouldn't be too bad, I hope. I would start with grouping all related functionality. Going with the blog example, take all functions related to posts and group them together, and do the same with categories, non-post pages, users/authors, etc. Basically any table in your database could be a type of object (a class), and each row in the table would be an instance of that object.

Here's an example I found on Google of using PHP for a simple Post class: http://www.php-editors.com/articles/simple_php_classes.php

Sorry I don't know about any good PHP OOP references, but if you have any questions about OOP in general, I'd be happy to help.

# (2 of 3): Tim » veryraw.com

2 hours, 17 minutes after the fact. (Thu 22 Sep 2005, 1:31 PM CST)

There are two boks that I recommend, Professional php5 I have been reading it off and on for a while and going back and reading sections over. The books is well written and interesting. Crash course in OOP. The long winded, metaphysical crap is important though because you have to learn how to program in the OO way of thinking. Its a very different mindset. Unfortunately I don't have a reason for OOP at work because everything we do is very piece meal. I do however recommend it. Very solid, very down to earth with only a little bit of bullshit.

The one prior to it in the series is also good beginning php5 is excellent. You will guarenteed skip the first handfull of chapters but there are topics like PEAR and source control that really benefited me.

Hope this helps.

Previous comment Return to entry

# (3 of 3): Matthom

6 hours, 36 minutes after the fact. (Thu 22 Sep 2005, 5:50 PM CST)

Thanks Jennifer and Tim.

I'll be sure to ask both of you questions, when I get stuck with something...

Previous comment Return to entry

RSS feed for comments on this post

Leave feedback

Feedback

Input format: The editor controls below will assist with Markdown syntax.

Status

Sub-status

Your info

Return to entry.

matthom is published and produced by Matt Thommes - an independent publishing enthusiast, mobile blogger, content creator, informative writer, web developer from Chicago. Never one to conform, Matt intends to promote the effect the web has on our lives, in an effort to intensify, instruct, and clarify all that is happening around us.

Contact Matt

I’ve been looking for a good reference on object oriented programming, in PHP - but I’ve had no luck.

You are at the feedback permalink page for: PHP OO programming references?

Read more...