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

Posted by Marcin Dobrucki on 09/19/05 14:13

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.

/Marcin

 

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

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