On Tue, Jul 21, 2009 at 10:53 AM, Marko Korhonen < [email protected]> wrote:
> > Thanks fo everybody for the great comments! > > I decided to change my getInstance() method so it just > created new instance of the class and returns it (giving up on singleton > on this case). > > So if I have static call: > $model = Comment_Model_Comment::getInstance(); > it's the same if I would write: > $model = new Comment_Model_Comment(); > > Only difference being that I can call directly some methods like: > $comments = Comment_Model_Comment::getInstance()->getAll(); > > Any considerations to this one? > > getInstance implies it is a Singleton. You are describing a factory method. - pw
