Jump to content

Archived

This topic is now archived and is closed to further replies.

mrome

php Classes

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
[quote author=hvle link=topic=100364.msg396091#msg396091 date=1152757637]
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.
[/quote]

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.

Share this post


Link to post
Share on other sites
[quote]
functional, declarative, sequential, procedural, and object oriented, you can combine them all together you can really do much much more
[/quote]
yes, very true.


Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.