[TYPO3-mvc] How to extend a model class from within another extension?

Martin Kutschker masi-no at spam-typo3.org
Mon Jan 18 21:04:54 CET 2010


Sebastian Kurfürst schrieb:
> 
> The main reason why we did not decide yet was that in FLOW3, we can
> implement that functionality via Aspect Oriented Programming, and we'd
> really like a way to extend classes which is upwards-compatible.

I think this could be done with a kind of cross-breed between a stripped-down AOP and the good ol'
XCLASSing.

As every class is load with the class loader we can already detect if we want the "real" class or an
augmented one. Like in AOP we choose an augmented one provided by a "service" utilized by the
auto-loader that incorporates all changes configured by extensions. Stripped down is the thing
because for simplicity I would restrict the augmentations to additions and modifications of methods
of a particular class defined in a config file (eg ext_localconf.php) and not a complicated
annotation (which even allows pattern matches).

Masi

PS: Does the FLOW3 AOP system use proxy classes? I thought once it might be possible to create
merged replacement classes by using the PHP tokenizer.


More information about the TYPO3-project-typo3v4mvc mailing list