Andre Cerqueira wrote:
>>
>> $c = new Criteria(Author::NAME, "Leo");
>> $a = AuthorFinder::find($c);
>>
>> instantiated behavior for performing customizations:
>>
>> $c = new Criteria(Author::NAME, "Leo");
>> $af = new AuthorFinder();
>> $af->setLimit(5);
>> $a = $af->find($c);
>>
I think it should be constructor's job to set up an instance with the defaults. (no need for static in this case)
Am i missing something?


static, default behavior, probably accounts for 80% of uses:


Well, kinda, yeah. The other part of the equation is that this class is generated, which is what allows it to be static. The default values for things are built into the class as static properties or class constants or whatever.

The idea is that most of the time this class is really a static class, which needs no object instance to perform 'find' functions.

Of course, you're right, using it non-statically only is a solution, but it would be far more elegant (IMO) if that weren't necessary :)

Cheers,
Hans

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to