[Flow] Proxyclass Building is useless imho in 90%

Karsten Dambekalns karsten at typo3.org
Mon Nov 17 10:46:35 CET 2014


Hi.

On 07.11.2014, at 14:25, Carsten Bleicker <carsten at bleicker.de> wrote:

> In 90% of all classes proxy class building is not required.

While I am not sure it’s that much, there are sure more proxy class being built than needed, agreed.

> AFAIK its out of the box used f.e. in Entities to inject a flow persistence identifier.
> But couldnt this be done by simply shipping a trait for this? wich contains the property?

Well, using traits was not an option so far, because Flow (up to 2.3) still supports PHP 5.3. Be assured that we thought about uses for traits as soon as the landed in PHP.

> Also its used for AOP.
> AOP is imho this concept is used for user case scenarios.
> So isnt it enough to enable proxy class building by usecase (if you need it)
> and by default proxy class building is totaly disabled?

Sure we could detect AOP targets and selectively enable proxy class building.

> As i mentioned in jira, injection should work also without proxyclassbuilding.
> So f.e. @Flow\Inject could work on original classes, not only on proxy classes.

Alright, if you have *any* idea for making this work, let us know. We didn’t find any. And this is not a try to troll you or anyone else.

> If proxy is "must be switched on" it results in:
> 1.) the proxyclass building time should be reduced a lot.

+1 to that.

> 2.) you can use debug breakpoints

Granted, this is cumbersome. But a simple debug_break() for the first breakpoint does wonders, and as soon as the debugger kicked in you can use IDE breakpoints as you like, because those are actually set in the proxy classes.

Another option is this proxy, although I am not sure if it works currently: https://github.com/sandstorm/debugproxy. More on that in http://sandstorm-media.de/blog/2012/08/09/debugging-flow3.html and http://techblog.b-have.de/typo3-flow-xdebug/

> 3.) you know what a class realy does without looking for maybe existing AOP magic

No, because what if it is switched on? You swap "looking for AOP magic" to “looking for AOP being turned on” in the first place ;)

> 4.) you dont run into exceptions if flow tries to build proxy for Foo extends \ArrayObject{}

Needs to be fixed anyway. Is there an issue for that?


Regards,
Karsten


More information about the Flow mailing list