You are here: Re: factory pattern in php « PHP Programming Language « IT news, forums, messages
Re: factory pattern in php

Posted by Andy Hassall on 11/15/10 11:22

On Tue, 26 Jul 2005 14:43:36 -0600, "Michael G" <mike-g@montana.com> wrote:

>>> function create($className) {
>>> return new $className;
>>> }
>>>
>>> Not sure if it's a better solution though.
>>>
>>
>> That's not a bad idea. It would eliminate the need for an array of
>> strings.
>
>Just a note, some languages would not allow that. That makes me a bit
>uncomfortable. They would require an explicit open/closed paran at a
>minimum.

But you're not writing in other languages, you're writing in PHP where it's
valid syntax, so where's the problem?

--
Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool

 

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

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