Whats OOP?

This is a discussion on "Whats OOP?" within the PHP Forum section. This forum, and the thread "Whats OOP? are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Feb 16th, 2008, 09:45
Jack Franklin's Avatar
Resources Administrator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,266
Blog Entries: 7
Thanks: 10
Thanked 4 Times in 4 Posts
Whats OOP?

Object Orientated Programming? What exactly is it, why is it better/worse than normal PHP, is it worth learning, where do I learn it?

A few questions for you guys

Jack
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
Reply With Quote

  #2 (permalink)  
Old Feb 16th, 2008, 09:52
welshstew's Avatar
Lead Administrator

SuperMember
Join Date: May 2007
Location: inside the outside
Posts: 1,325
Blog Entries: 12
Thanks: 1
Thanked 4 Times in 4 Posts
Re: Whats OOP?

OOP is just a way to organise your prgramming so that it's better

a general example.

you have many objects:
  • wheel
  • engine
  • steering
  • suspension
  • lights
  • etc
now you can combine these objects in any number of ways to make up another object:
  • car
  • bike
  • plane
  • etc
so, basically, you define objects that are reuable in multiple places.

does that make sense? can you now see the benefits of this?
__________________
WelshStew
Lead Administrator

tierney rides tboard - uk site | xtreme wales - extreme clothing
If you think I've helped, click the "Thanks"
webforumz - facebook | LinkedIn
Last Blog Entry: Opera 9.5 Released ! (Jun 12th, 2008)
Reply With Quote
  #3 (permalink)  
Old Feb 16th, 2008, 10:00
Jack Franklin's Avatar
Resources Administrator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,266
Blog Entries: 7
Thanks: 10
Thanked 4 Times in 4 Posts
Re: Whats OOP?

Sort of yes. But I see no benefits?
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
Reply With Quote
  #4 (permalink)  
Old Feb 16th, 2008, 10:05
welshstew's Avatar
Lead Administrator

SuperMember
Join Date: May 2007
Location: inside the outside
Posts: 1,325
Blog Entries: 12
Thanks: 1
Thanked 4 Times in 4 Posts
Re: Whats OOP?

because the objects you define are generic, you can reuse them over and over again in different areas.

you don't have to write specific custom code for a function everytime, you just build it up.

like lego
__________________
WelshStew
Lead Administrator

tierney rides tboard - uk site | xtreme wales - extreme clothing
If you think I've helped, click the "Thanks"
webforumz - facebook | LinkedIn
Last Blog Entry: Opera 9.5 Released ! (Jun 12th, 2008)
Reply With Quote
  #5 (permalink)  
Old Feb 16th, 2008, 12:21
Jack Franklin's Avatar
Resources Administrator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,266
Blog Entries: 7
Thanks: 10
Thanked 4 Times in 4 Posts
Re: Whats OOP?

Ahh I see. Thanks Stew.
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
Reply With Quote
  #6 (permalink)  
Old Feb 16th, 2008, 12:30
alexgeek's Avatar
Administrator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,771
Blog Entries: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alexgeek
Re: Whats OOP?

Encapsulation, Polymorphism, reuse and inheritance are the main aspects of OO.
People usually use object orientated code when working with other developers as it's neater to code in.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Reply With Quote
  #7 (permalink)  
Old Feb 16th, 2008, 17:43
Junior Member
Join Date: Feb 2008
Location: Small Buziness!
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Whats OOP?

Hi,

http://en.wikipedia.org/wiki/Object-...ed_programming
Reply With Quote
  #8 (permalink)  
Old Feb 17th, 2008, 20:01
Junior Member
Join Date: Feb 2008
Location: Glasgow
Age: 28
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Whats OOP?

I think the main reason to learn OO PHP is the number of frameworks being released which nearly all are OO based. They can drastically reduce the time taken on projects.
Reply With Quote
  #9 (permalink)  
Old Feb 17th, 2008, 20:10
Jack Franklin's Avatar
Resources Administrator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,266
Blog Entries: 7
Thanks: 10
Thanked 4 Times in 4 Posts
Re: Whats OOP?

Thanks guys. Anyone know where the best place is to start? Or a book, I'm happy to buy a book?
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
Reply With Quote
  #10 (permalink)  
Old Feb 17th, 2008, 20:48
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Whats OOP?

Hi Jack,

I think it's a bit hard to realise the full potential of OOP until you start using it. I was the same when I first heard of it, wondering what all the fuss was about.

I wrote an article for CC in October http://creativecoding.webforumz.com/...rest-of-us.php which is a nice introductory look at OOP in PHP.

There are also many beginner-intermediate tutorials online. A search for OOP in PHP will yield many results in google.
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Reply With Quote
  #11 (permalink)  
Old Feb 19th, 2008, 01:36
Junior Member
Join Date: Feb 2008
Location: Glasgow
Age: 28
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Whats OOP?

The single best introductory explanation of oo I ever read was by bruce eckle in 'Thinking in Java' - don't let the java bit put you off, the intro to the book just talks about oo rather than java and it's available free online.
Reply With Quote
Reply

Thread Tools

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Whats in a name? jhappeal Webforumz Cafe 15 Nov 6th, 2007 19:56
Hi All Whats Up DarkwizarD Introduce Yourself 6 Jun 27th, 2007 07:15
Whats the best way to do this? GCpd Website Planning 4 Jun 17th, 2007 09:53
Whats up jjgamepro17 Introduce Yourself 6 Nov 8th, 2006 14:48
Whats a CGI-Bin? NewDesigner Web Page Design 6 Sep 3rd, 2006 03:33


All times are GMT. The time now is 22:04.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43