On 7/21/05, David Zülke <[EMAIL PROTECTED]> wrote:
> > functional constructors.  Would you be ok with the optional singleton
> > parameter being 4th in the method signature?
> >
> > Controller::getModel($module, $model, $args=null, $means=null)
> 
> I'm not sure if it belongs there. It somehow disrupts the logical order of
> things. And it might also make sense to allow an unlimited amount of
> parameters, what do you think? Using an optional array for $model to provide
> model and getInstance would also imitate PHP's native behaviour, for example
> in call_user_func():
> http://www.php.net/manual/en/function.call-user-func.php
> 
> If we decide to implement parameter passing in
> Controller::get(Global)Model(), we have to settle on how it would work, i.e:
> 
> a) pass an array and hand it to the constructor as an array
> b) pass an array and hand it to the constructor as an unpacked sequence of
> values
> c) pass a sequence of values and hand them to the constructor
> 
> I'd favour the third one.

getModel((string) $module, (string) $model, (array) $options=null)

$options being an associative array which could affect how we
propogate the model that we  inspect for some documented keys?

eg:
$options['model_args'] = array('sompn' => 43, 'name' => 'Joe', 'arg3' => true);
$options['extract_args'] = true; // blow the model_args array out to ind args
$options['call_method'] = 'getInstance'; // propogate via getInstance vs. new

etc.. yea? 


-Mike
_______________________________________________
agavi-dev mailing list
[email protected]
http://labworkz.com/cgi-bin/mailman/listinfo/agavi-dev

Reply via email to