When to put factory() method into factoried object and when put factory() method to separated class?
<p>Is it ok to put <code>factory()</code> method to the factoried object's class?</p>

<pre><code>class User {

    public static function factory($id) {
       return new User($id);
    }

    private function __construct($id) {

    }

}
</code></pre>

<p>And when consider placing factory() method into separated class?</p>

<pre><code>class User {

    public function __construct($id) {

    }

}

class UserFactory {

    public static function factory($id) {
        return new User($id)
    }

}
</code></pre>

<p>I can't see any benefits of using additional class for factory, but I consider that there are some benefits I don't know about. :)</p>

<p>When to put <code>factory()</code> method into factoried object and when put <code>factory()</code> method to separated class?</p>
