You are here: Re: Constructor as a "Reset" Button « PHP Programming Language « IT news, forums, messages
Re: Constructor as a "Reset" Button

Posted by Sanders Kaufman on 07/25/07 04:57

ZeldorBlat wrote:

> Because you move don't duplicate the functionality -- you move it to
> it's own method and call that from the constructor. That way you
> don't need to call the constructor to reset things, and you don't need
> to duplicate any code. That's what we've been trying to say all along
> -- but you haven't seemed to have caught on.

Oh, I get it.
I just don't see a reason to do it that way.

In fact - that particular way actually seems even MORE unnecessarily
complex than the one the other guy provided where my "init()" function
would call the constructor.

In your case, every time my object is initialized, it would make TWO
function calls, instead of one - one to the constructor, and one to the
init().

That violates a core design principle - that it be very scalable; and
that means that it must not use resources unnecessarily.

 

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

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