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

Elmar Hinz elmar07 at googlemail.com
Tue Aug 14 09:24:15 CEST 2007


> Hi,
> 
> I work with TYPO3 since version 3.5 and have actually created two
> frameworks for my own extensions to include the MVC-approach in my
> development process.
> 
> Now I want to migrate completely to lib/div, because I see the benefits
> of a community-driven framework, which have the possibility to change
> the way extensions are developed in a extrem positive way.
> 
> When I look into the sources of lib I see a lot of object-references
> (-copies). I mean, the controller creates the different objects
> (context, parameter, configuration) and "copies" itself to all of these.
> 
> I made this also in my first framework, but after a while I found it
> annoying, think e.g. at a var_dump of a controller-object, which will be
> unclear, because the dump of the controller-object is repeated again and
> again.
> 
> Amongst other things I created a new framework, which included the
> Registry-Pattern in such a way, that I can register objects and call
> them from every place I need to.
> 
> I think such a technique can be usefull for the controller, too. As soon
> as the controller is initialized it registers itself e.g.
> (tx_registry::register('ctrl', $this);), after this, it can be called
> from everywhere (tx_registry::retrieve('ctrl')->doControllerMethod();).
> 
> 
> What do you think about this?
> 
> Regards
> 
> Joerg Schoppet


Hello Joerg,

this sounds like the most innovate suggestion made since a while. From my
first impression, we should do this. It comes in the right moment, because
I want to do the last mayor improvements for the first release candidate of
the beta branch.

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.

But I have 2 questions:

1.) Should we use the same pattern for the parameters and the configurations
object?

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.

Regards

Elmar



























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