[TYPO3-ect] Registry-Pattern for lib/div?

Joerg Schoppet joerg at schoppet.de
Tue Aug 14 09:54:50 CEST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

see below:

Elmar Hinz wrote:
 > Hello Joerg,
> 
> ...
> 
> If you have further suggestions that would have an impact for the API please
> hurry, because it's a problem to change the API once the beta branch has
> been started.
Some things of the API have to change, because e.g. within the context,
you would not call anymore $this->controller... but
tx_registry::retrieve('ctrl')...
Additionally you would not say:
$obj = tx_div::makeInstance($this->contextClassName);
$object->controller($this);
The second line would be removed completely.

> 
> But I have 2 questions:
> 
> 1.) Should we use the same pattern for the parameters and the configurations
> object?
Actually I'm not so deep in lib/div as I like to be, but if I understand
it right, the paramters and the configurations object are "global"
objects, and if this is true I would say *YES*, they can be registered
with tx_registry::register($extKey . 'param') and
tx_registry::register($extKey . 'conf') for example.
But then, there is no need anymore to bind these objects to the
controller -> API change.

> 
> 2.) We have the tree of plugins. How does the registry know, which
> controller is needed for the current plugin? Example: The program flow is
> in the result browser and the result browsers controller is requested.
As mentioned above, I need more code insight and practial experience to
answer this question accurate, my framework only uses one controller at
a time. But here a suggestion (don't know if it is possible): If the
configuration-object is globally available, and if I can see through the
actual configuration, at which place I am, the configuration-objects can
be traversed to retrieve the right controller. Then, we only need to
define a rule, with which unique name each controller will register.

> 
> Regards
> 
> Elmar

P.S.: I can provide the code for a simple registry-object, but it is
PHP5 only.


Regards

Joerg
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGwV/Kq5Me6rRDqPURAhxGAJ9sE2KMqu2gJChCrtScZ7D6MnckiwCfTixV
mP/f2QjGCedsHpUXksO/8Tc=
=aIHV
-----END PGP SIGNATURE-----


More information about the TYPO3-team-extension-coordination mailing list