Aspect Oriented Javascript, revisited
0
Last night I was experimenting a bit with a minimalist implementation of
advising in Aspect Oriented Javascript. I implemented the three basic advices
(before, around and after). For this naive implementation I slammed the
functions in the Object’s prototype. This way I had access to them in all
objects in the system.
Here’s how to use them.
The actual code written is very small (20 lines, less if you discount lines
taken by braces)
This way you can add any sorts of filters to your JavaScript methods. An enhancement
on this would be enabling the removal of these filters once added and to add a
filter to all functions of an object (recursively) at once.
Obviously, we need some protection against users trying to advise non
function members or even undefined properties for that matter.
Post a Comment
eSpace podcast Prodcast
Archive
- September 2011
- April 2011
- March 2011
- December 2010
- November 2010
- September 2010
- August 2010
- July 2010
- June 2010
- April 2010
- March 2010
- November 2009
- October 2009
- September 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- November 2008
- October 2008
- September 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- January 2008
- April 2007
- March 2007
Latest Comments
- SpectraMind Commented on Egypt Wins UK's National Outsourcing Association Award
- Rofaida Awad Commented on Go Egypt Go!
- Different Mike Commented on Only idiots change their iPhone root password!
- Mike Commented on Only idiots change their iPhone root password!
- smile Commented on Only idiots change their iPhone root password!

