Questions for OOP Beginner:

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have been writing php code using the procedural method for a couple of years now.  I use php along with MySql primarily.  I am self-taught from library books, books I have purchased, and just trying out different ideas. Lately, I have started encapsulating a lot of my code inside functions, and since this is not too much different than OOP, I decided to try to learn OOP php.  I have been reading the chapters on OOP in my php books and the online php manual.  There are some things that I can't seem to find answers for (either in my books, the on-line manual, or in some code I downloaded and read through):

1) If I need data from another object is it correct or proper to use the attribute of one object passed to the constructor of another object?

2) Is correct or proper to instantiate a new object inside the class of another object (either in a public method or inside the constructor method)?

3) I read one author who said the results of queries to a mysql database should be their own objects.  Can some one point me to some examples or explain how they have put this into practice?

I appreciate any help I can get in understanding these things.

Gentlemike2


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux