AOP Compatibility

Kris Zyp kris at sitepen.com
Wed Feb 20 10:17:28 PST 2008


It seems that one of more significant remaining compatibility issues with 
ES3 is the inability to set AOP advice on all methods. Many frameworks rely 
on the ability to replace functions in order to add advice/listen to 
methods. For example, this is how dojo.connect works, although this is 
certainly not the only function that uses this technique. This might not 
fail compatibility tests in the sense that pure ES3 code (no classes) will 
still operate properly in an ES4 environment. However, when ES4 classes are 
mixed with existing ES3 framework code, and when instances of classes are 
passed to AOP functions like dojo.connect, the AOP function will fail to be 
able to replace the function to add advice.
Is there any way this compatibility can be mitigated? I am assuming there is 
no conceivable way to actually replace methods ad-hoc with arbitrary 
functions and retain sane typing and class expectations. However, would a 
more controlled AOP API be a reasonable approach to adding AOP advice to 
methods? At least, frameworks could be altered to handle the difference 
between ES4 class and dynamic Object, and use the AOP API when appropriate, 
and therefore general AOP providing functions could be altered to work in 
both ES3 and ES4 environments. I don't know if there another way to mitigate 
this incompatibility...
Thanks,
Kris 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.mozilla.org/pipermail/es-discuss/attachments/20080220/990acce3/attachment-0002.html 


More information about the Es4-discuss mailing list