You are here: Re: Using a Resource as a Class Property « PHP Programming Language « IT news, forums, messages
Re: Using a Resource as a Class Property

Posted by Sanders Kaufman on 07/23/07 15:10

Sanders Kaufman wrote:
> Toby A Inkster wrote:

> So to correct my statement:
>
> In OOP (not just PHP) the constructor of the grandest child :) will be
> called when a class is instantiated as an object.

Wow, now that I've done it that way, I can see why it's the better way.
By having to call the parent constructor from within the child object,
It gives the child better control.

For example, my parent has a "database" object, and a built-in default
way of talking to it; while the child has another way of talking to it -
each established in the constructor, and each running a verification
process to ensure it still works

So now I can have the child set the values for the conversation before
the parent .... blah, blah, blah.

Bottom line - I talk to the DBMS once, instead of twice during
initialization.

Cool.
Thanks.




>
> Zat right?
>
> Vocabulary question: When I do this, what is the OOP thing that I'm
> doing? You said that my use of an object as a property of the parent
> class was "aggregation. So - when I use use "extends" to create the
> child's reference to the parent - wassat? Marshalling? Inheritance?
>
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация