You are here: Re: instantiating an object fails (design patterns) « All PHP « IT news, forums, messages
Re: instantiating an object fails (design patterns)

Posted by www.douglassdavis.com on 09/20/05 07:10

Marcin Dobrucki wrote:
> Oli Filth wrote:
> > Marcin Dobrucki said the following on 16/09/2005 13:37:
>
> > What? How does that help?
> > If initialize() "fails" then the constructor has still "failed"...
>
> Close, but there are some benefits:
>
> "initialize" can do some gracious exist upon failure, still allowing
> you to create an object (albeit sans whatever the initalization was
> supposed to do, like values from DB or something). This is somewhat
> useful in avoiding getting the "method called on a non-object" errors.
>

With all due respect, i could do the same in the costructor. it's just
a matter of copy and paste.

 

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

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