On 12/3/12 1:36 AM, Victor Berchet wrote:
On 12/03/2012 08:26 AM, Larry Garfield wrote:
Be very careful with that.  AOP is a flame thrower; very powerful, but
can also burn you quite badly.  If you're not extremely careful, it
can make effective unit testing next to impossible.
Larry, could you please give more details on why it could made
"effective unit testing next to impossible" ?

Cheers,
Victor

Disclaimer: The only AOP system I've worked in is Drupal, so my perspective is somewhat skewed. I've already read about how AOP has been implemented in some .NET systems, which is where the rest of my knowledge comes from. I do not claim to be an expert on the subject.

Basically, though, adding an aspect implicitly to a class means that you don't know what aspects have been added, which means you don't have complete control over your environment, which means you cannot carve out a "unit" to test. (This is one of the key problems keeping most Drupal from being properly unit testable.)

If you add an aspect to an object explicitly, then I really don't see how it's any different from EventDispatcher.

The line between AOP and events is, in my understanding, somewhat fuzzy to begin with.

--Larry Garfield

--
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to symfony-devs@googlegroups.com
To unsubscribe from this group, send email to
symfony-devs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to