Jump to content


Photo

php Classes


  • Please log in to reply
3 replies to this topic

#1 mrome

mrome
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 13 July 2006 - 12:16 AM

Does anyone know where I can have a good read about how classes work in php.

Because I have a few questions.

Do they get held across requests or do they get destroyed once the response has been sent?

Why we have an OO way of writing and a procedural way of writing something.

Is the OO way faster? smarter? Or is it purely readiblity?

If anyone has a good grounding in this topic, please send me a link to some information about it.

#2 hvle

hvle
  • Members
  • PipPipPip
  • Advanced Member
  • 667 posts
  • Locationmelbourne, Australia

Posted 13 July 2006 - 02:27 AM

I can answer most (if not all) your questions on OOP.

Yes, they got destroyed once script exited.  Actually everything got destroyed once the script exited.  That's why you need to use SESSION

OOP is wonderfull and best method of programming.  If everything in your site is OO and having a nice design structure, you're ahead of everyone else.


Life's too short for arguing.

#3 gewthen

gewthen
  • Members
  • PipPip
  • Member
  • 11 posts

Posted 13 July 2006 - 03:05 AM

OOP is wonderfull and best method of programming.  If everything in your site is OO and having a nice design structure, you're ahead of everyone else.


I thought I would point out that there is no best way of programing. OOP is just one way. There are several different ways of programing anything: functional, declarative, sequential, procedural, and object oriented. All have their strengths. OOP provides the structure for those begining to program as well as any group programers who do not already know each other's style of programing.

Once you feel you got a good handle of OOP, move on to other styles. Try not to get stuck on one particular style, for when you can combine them all together you can really do much much more.

#4 hvle

hvle
  • Members
  • PipPipPip
  • Advanced Member
  • 667 posts
  • Locationmelbourne, Australia

Posted 13 July 2006 - 03:12 AM

functional, declarative, sequential, procedural, and object oriented, you can combine them all together you can really do much much more

yes, very true.



Life's too short for arguing.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users