473,406 Members | 2,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

object oriented php - primer

Could anyone give me a tip about a good primer on object oriented php
programming - why I should use it, the benefits, the drawbacks, the bugs, the
glory?

And, should I upgrade to php5 before starting to use it (to avoid two
standards)?

--
Sandman[.net]
Jul 17 '05 #1
7 1971
"Sandman" <mr@sandman.net> wrote in message
news:mr**********************@individual.net...
Could anyone give me a tip about a good primer on object oriented php
programming - why I should use it, the benefits, the drawbacks, the bugs, the glory?

I think this site has everything you need to know:
www.google.com

Yeesh.

Garp
Jul 17 '05 #2
MBR
Actually, I have a similar question, and I don't think Google will have
the answer for me. The question is not how to do OO in PHP. That I
can figure out on my own. I've done OO in straight C before C++ was
ubiquitous. I've written OO code in C++ and Java for over 10 years.
BUT my experience with web applications is that the associated server-
side code is usually fairly trivial, and structuring things in a class
hierarchy is generally overkill.

So, my question is not how do people do object oriented programming in
PHP, but rather why? Under what circumstances does it really provide
any benefit?

Mark
mb*@arlsoft.com

Garp wrote:
"Sandman" <mr@sandman.net> wrote in message
news:mr**********************@individual.net...
Could anyone give me a tip about a good primer on object oriented php
programming - why I should use it, the benefits, the drawbacks, the bugs,


the
glory?


I think this site has everything you need to know:
www.google.com

Yeesh.

Garp


Jul 17 '05 #3
MBR wrote:
So, my question is not how do people do object oriented programming in
PHP, but rather why? Under what circumstances does it really provide
any benefit?


For me, the reason to use OO in PHP is the same as in any other language: OO
makes things better organized and easier to maintain.

There is to inherent advantage in using OO above procedural or other types
of programming except that it gives a better organization of your code,
making it much easier to reuse, maintain and publish.

Why do you use OO in Java? (Note: one can easily write a completely
procedural program in Java).

Berislav

--
If the Internet is a Marx Brothers movie, and Web, e-mail, and IRC are
Groucho, Chico, and Harpo, then Usenet is Zeppo.
Jul 17 '05 #4
In article <Et*******************@news-text.cableinet.net>,
"Garp" <ga***@no7.blueyonder.co.uk> wrote:
Could anyone give me a tip about a good primer on object oriented php
programming - why I should use it, the benefits, the drawbacks, the bugs,
the glory?


I have no idea what so ever, and it would even be stupid of me to reply to
your post.

Garp


Ok, thanks anyway.

--
Sandman[.net]
Jul 17 '05 #5

"Sandman" <mr@sandman.net> wrote in message
news:mr**********************@individual.net...
In article <Et*******************@news-text.cableinet.net>,
"Garp" <ga***@no7.blueyonder.co.uk> wrote:
Could anyone give me a tip about a good primer on object oriented php
programming - why I should use it, the benefits, the drawbacks, the bugs, the glory?


I have no idea what so ever, and it would even be stupid of me to reply to your post.

Garp


Ok, thanks anyway.

--
Sandman[.net]


I'm sorry, but the question was as wide open as you could have made it. This
isn't the right forum to ask for such general advice (you didn't even
specify PHP for the OOD part), and I'm glad you got the point I made,
however badly you spelled "whatsoever".

Garp
Jul 17 '05 #6

"Berislav Lopac" <be************@dimedia.hr> wrote in message
news:ca**********@ls219.htnet.hr...
MBR wrote:
So, my question is not how do people do object oriented programming in
PHP, but rather why? Under what circumstances does it really provide
any benefit?
For me, the reason to use OO in PHP is the same as in any other language:

OO makes things better organized and easier to maintain.

There is to inherent advantage in using OO above procedural or other types
of programming except that it gives a better organization of your code,
making it much easier to reuse, maintain and publish.

Why do you use OO in Java? (Note: one can easily write a completely
procedural program in Java).

Berislav


All good points; simply put, OOD is simply a way of organising solutions to
problems. It's just a good way to think about the problems you encounter
every day in your work and this is evident in all the languages that either
integrated OO in their middle age or grew out of the concept itself. I do it
because I only have to solve problems once. When I don't do it, after the
third or fourth cut & paste I wish I had.

Garp
Jul 17 '05 #7
I've written a couple medium sized programs (~10,000 lines) in php and
one of the main reasons I use OO is to keep the namespace clean. Most
of my apps have done a lot of db queries so you get a lot of $query
and $row variables. This can become a problem if your using a lot of
require statements to import code and not using OO or functions at the
least. Classes are also a lot easier for me to read and use than a
bunch of multi-dimensional arrays for passing data around. However, I
don't think OO is really about encapsulation as much as it is about
abstraction, but I'll leave that discussion alone. I don't find a lot
of reasons to have hierarchies of classes in the apps I've worked on
in php.
Jul 17 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Martin | last post by:
When was inheritance intruduced into object oriented programming? More generally, does anyone know or have any sources on when the different features were introduced into object oriented...
11
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in...
65
by: Roger Smythe | last post by:
A means for the progressive decomposition a problem space into increasingly simpler component parts such that these component parts represent higher levels of conceptual abstraction, and are...
14
by: Rookie | last post by:
Is C an object oriented programming language?
47
by: Thierry Chappuis | last post by:
Hi, I'm interested in techniques used to program in an object-oriented way using the C ANSI language. I'm studying the GObject library and Laurent Deniau's OOPC framework published on his web...
46
by: ajba74 | last post by:
Hi fellows, I am reading some books to learn the C programming language, and sometimes I have the feeling that when somebody becomes a C expert, he must learn a more modern and object-oriented...
15
by: waltbrad | last post by:
Hello. I'm studying the book "C++ Primer Plus" by Stephan Prata. In chapter 6 he gives an exercise that reads from a file. The list is thus: 4 Sam Stone 2000 Freida Flass 100500 Tammy...
3
by: notnorwegian | last post by:
i have some confusion over this. sure a class is basically a classification, like for example an animal or flower. and an object/instance of that class is then for example a cat. an object is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.