JMSAopBundle icon indicating copy to clipboard operation
JMSAopBundle copied to clipboard

Reusable approach to enhanced proxy generation

Open nfx opened this issue 13 years ago • 9 comments

Goal:

  • some bundles want to define their own code enhancement rules
  • if two bundles enhance the same class - there would be no risk of conflicts
  • couple of bundles won't overwrite changes of each other, as they'll define their own generators

How:

  • added proxy enhancer repository
  • supported code with tests
  • fixed single failing test with outdated class name
  • now tests run normally on 2.1 composer based install

Regards, Serge

nfx avatar Jun 20 '12 01:06 nfx

Hey, thanks for the patch.

There are a few CS issues, but I don't want to comment on them for now. Maybe you could show an example of how you would use these changes in your code?

schmittjoh avatar Jun 20 '12 01:06 schmittjoh

Usage should be like https://github.com/nfx/AsyncBundle/blob/master/DependencyInjection/Compiler/CollectAsyncTasksPass.php#L72

nfx avatar Jun 20 '12 02:06 nfx

so, what should i change?

nfx avatar Jun 25 '12 14:06 nfx

sry, did not have time yet to look into this.

On Mon, Jun 25, 2012 at 4:18 PM, Serge Smertin < [email protected]

wrote:

so, what should i change?


Reply to this email directly or view it on GitHub: https://github.com/schmittjoh/JMSAopBundle/pull/8#issuecomment-6548417

schmittjoh avatar Jun 25 '12 14:06 schmittjoh

ping

nfx avatar Sep 08 '12 16:09 nfx

This is not really related to AOP; could we add this to another bundle, maybe even Symfony itself?

schmittjoh avatar Sep 19 '12 09:09 schmittjoh

hm, actually Symfony itself would even be a better solution, as it is directly related to class proxy generation. Where do you think we need to put it?

nfx avatar Sep 19 '12 18:09 nfx

Before you start writing code, I'd first start a discussion about it either on Github (symfony/symfony), or the symfony-dev mailing list.

This could not only be used for AOP, but also to implement lazy-loading for services (@lsmith and others might be interested in this).

On Wed, Sep 19, 2012 at 8:51 PM, Serge Smertin [email protected]:

hm, actually Symfony itself would even be a better solution, as it is directly related to class proxy generation. Where do you think we need to put it?

— Reply to this email directly or view it on GitHubhttps://github.com/schmittjoh/JMSAopBundle/pull/8#issuecomment-8702062.

schmittjoh avatar Sep 19 '12 18:09 schmittjoh

So, what are we going to do? Me doing better implementation to be included in CG-lib or finishing up with this commit? Either option works.

nfx avatar Nov 08 '12 22:11 nfx