[TYPO3-ect] News about XCLASSES?

Elmar Hinz elmar.DOT.hinz at team.MINUS.red.DOT.net
Wed Aug 23 01:37:38 CEST 2006


Joerg Schoppet wrote:
> Hi list,
> 
> one of "my" big problems within TYPO3 is the XCLASSES-princip. On the 
> one hand it a nice thing to extend existing classes within an extension, 
> but on the other there are the big problems, having two extensions 
> xclassing the same base-class.
> 
> I'm actually in progress to develop a new method for this for my own 
> extensions (using decorator-pattern). Just want to ask if somebody else 
> have made some thoughts about this taks?
> 
> Regards
> 
> Joerg Schoppet


Hi Joerg,

to use the decorator pattern is an interesting idea for extensions. It 
should indeed be considered as an alternative possibility to "extend" 
extensions. The link object tx_lib_link works that way, well not with an 
extension but with the infamous tslib_cObj.

If you call the main() function of the "wraped" extension and set 
$this-cObj you could build unlimited chains of extensions. The drawback is 
that you can't do a lot with the main function. On the input side you could 
alter the TS-setup, but you could do that with TS as well. On the output 
side you have to deal with a string of HTML. You need to work with a lot of 
regular expressions to change something, wich is not a very smart way to do it.

You could decide to replace the main function, instead of recursively 
calling it. That could  open interesting possibilities, both with and 
without instantiating the wrapped object explicitley.

You could i.e. replace a switch-case controller inside the main()-funcition 
with a more flexible controller like Michael Scharkow has demonstarted, 
like I implemented it into tx_lib_controller.

Please share your concepts and experiences.

Regards

Elmar










































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