[dev] (sesha) Horde_Forms and data sources
Jan Schneider
jan at horde.org
Fri Jan 13 18:17:55 UTC 2012
Zitat von Michael J Rubinsky <mrubinsk at horde.org>:
> Quoting Ralf Lang <lang at b1-systems.de>:
>
>> Currently in converting sesha, several Horde_Form descendants
>> create a sesha_driver in their constructor.
>
> Generally, you would want to create a factory for the driver and use
> the $injector to obtain an instance of it.
>
>> I'd rather move constructing the driver somewhere out of the form
>> constructor.
>>
>> Is it valid to pass the sesha_driver or the relevant data in the
>> constructor, changing the signature of Sesha_Forms_*::__construct
>> to be different from Horde_Forms::__construct ?
>
> If it's not posisble to use a factory and the injector for some
> reason, then it shouldn't be a problem to inject the driver into the
> Sesha_Form's constructor.
A setter would be cleaner though, because it wouldn't require to
change the constructor signature.
Generally it's fine to use the global injector object in application
code though.
Jan.
--
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/
More information about the dev
mailing list