Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Real Examples of OOP PHP Sites!!
Old 11-23-2010, 02:29 PM Real Examples of OOP PHP Sites!!
sepple's Avatar
Super Talker

Posts: 147
Trades: 0
Ok, I have a good understanding of OOP PHP. I understand abstract classes and subclasses and inheritance, etc, etc...

I've read through books and tutorials and after all this, I can only program a site if I want abstract Animal classes and subclasses full of Dogs and Cats that can eatFood() and poopInGrass().

After some exhaustive searches, I cannot find actual real life examples of how to setup a site using OOP. I can take guesses on how to start but if I wanted to program a site where I post topics and users post comments (to make it easy, like a blog). How do I start this?

Do I have one class named site_posts() and functions within this to save new posts, display all posts and get specific posts? Then I use a page that includes a header and footer along with site_posts class and call the displayAllPosts function?

This piece seems missing from tutorials and online videos and books from the library. Does anyone know wheres the place to start?

Thanks!
__________________
Thanks
Stephen
sepple is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-23-2010, 03:13 PM Re: Real Examples of OOP PHP Sites!!
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
You can try taking a look at some existing CMS's. Wordpress would be a good start.

Try to think of your application in terms of object interactions. You might have a Database class that handles all of your queries. It may contain a method getPost that returns a single Post object. The post object would encapsulate all of the details of a particular post (author, title, content, date created, etc).

It is a lot easier to teach OOP syntax than it is to teach OOP design, which is why it is difficult to find a tutorial that goes far beyond the basics of creating and using objects. I think it's something that you will get a feel for over time, and the best thing you can do is look at existing code (so long as the source is credible) and try to design and use your own objects.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 11-27-2010, 12:08 AM Re: Real Examples of OOP PHP Sites!!
Backslider's Avatar
Experienced Talker

Posts: 40
Trades: 0
Have a play with the Yii Framework
Backslider is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Real Examples of OOP PHP Sites!!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11838 seconds with 12 queries