Is is possible to create a factory class in PHP?

Posted by user198729 on Stack Overflow See other posts from Stack Overflow or by user198729
Published on 2010-03-21T05:27:28Z Indexed on 2010/03/21 5:31 UTC
Read the original article Hit count: 214

Filed under:
|

Like the BeanFactory in java:

In the much more common case where the BeanFactory itself directly creates the bean by calling its constructor (equivalent to Java code calling new), the class attribute specifies the class of the bean to be constructed. In the less common case where the BeanFactory calls a static, so-called factory method on a class to create the bean, the class attribute specifies the actual class containing the static factory method.

Note:it's not the factory method

© Stack Overflow or respective owner

Related posts about php

Related posts about factory-pattern