[TYPO3-mvc] Proposal: mixed-ins for extbase

Helmut Hummel helmut at typo3.org
Mon Aug 2 09:24:43 CEST 2010


Hi Sebastian,

On 02.08.10 08:49, Sebastian Kurfürst wrote:
> 
> However, as a convenience feature, we planned to implement Mixins in
> FLOW3 as well (with AOP): http://forge.typo3.org/issues/6712 .

Oh, cool. I didn't find this one.

>> Before doing some work and provide a patch making this possible, I'd
>> like to hear if you think this is a good idea or not.
> In general, I think it is a nice and important feature, which would add
> a lot to Extbase. However I fear that it is difficult to implement with
> acceptable performance, but feel free to prove me wrong :-)
> 
> For the syntax of registering Mixins, I could imagine that we even use
> the same syntax as FLOW3, but additionally, the class still needs to be
> registered as mixin somewhere -- that way, mixins would be
> forward-portable later on.

I currently think of something like this:

persistence {
  classes {
    Tx_Extbase_Domain_Model_FrontendUser {
      subclasses {
	Tx_BlogExample_Domain_Model_Admin = Tx_BlogExample_Dom...
      }
      mixins {
        Tx_MyExt_FooBar = Tx_MyExt_FooBar
        Tx_YourExt_FooBar = Tx_YourExt_FooBar
      }
}

Of course also adding the @mixin annotation to the registered classes
would be no problem.

As of performance:
The only overhead after the complete class file has been generated would
be to get a hash of the mixin configuration.

Because with this hash the generated php file could easily be required
instead of the original class, wich has no performance impact at all.

> So, I look very much forward to example code :-)

Let's see :)

Regards Helmut


More information about the TYPO3-project-typo3v4mvc mailing list