The Blog

Mar 7, 2009

Flex Camp Miami: In Search of AOP for AS3 (Maxim Porges) 

by Maxim Porges @ 8:48 AM | Link | Feedback (2)

Next, I gave my presentation on my search for adding AOP to ActionScript 3. My presentation materials are available here.

I was a little concerned about the level of my presentation and how it would be received, since Greg Wilson had already identified that many of the attendees were completely new to Flex. It's not often that as you are learning a language, you take a deep-dive under the hood to see how the bits and bytes are running in the virtual machine after they have been compiled.

I started off with an overview of AOP, since about 85% of the attendees had never heard of the term. Using examples from ActionScript and Java, I simulated AOP advice in code for ActionScript and then demonstrated how AspectJ already has AOP working beautifully.

I then moved on to describe my journey to discovery for how to implement AOP in ActionScript. I described how I started off trying to use the prototype model, setting the strict flag to false in the compiler, and finally attempting to use Proxy before giving up on the out-of-the-box toolset.

I then described the dynamic subclassing model (akin to how CGLIB works for Java) and how that was the only viable solution I had found. We then looked at how the Tamarin project had supported my research in to establishing a roadmap for understanding the inner workings of the AVM and getting dynamic subclassing working, and I demo'd some of the command-line tools that have become good friends to me in recent months as I have worked on Loom.

I had some interesting feedback from the session. Overall, I saw enough heads nodding as I was going through it to see that people were getting the general idea, which was all I was hoping for; the AVM2 spec is pretty boring stuff, and the idea behind Loom is that it will handle all the nitty-gritty for you so that you can just code in AS3 and have AOP capabilities at your fingertips. Nahuel Faronda told me that he had followed along 100%, and after seeing what I had to deal with to get Loom to work he was glad I was doing it instead of him. :)

While I'm hopeful people found my session interesting, I'm even more hopeful that they will download Loom and assist me with the beta program when I release the library later this month. As always, watch the blog and the Loom project site for updates.

All Flex Camp Miami Roundup Posts
Welcome and Keynote (Greg Wilson, Adobe)
Working with Data in AIR (David Tucker, Universal Mind)
In Search of AOP for AS3 (Maxim Porges, Highwinds)
Merapi or How To Blow Your Mind with AIR (Andrew Powell, Universal Mind)
The Art of Storytelling (Christian Saylor, Universal Mind)
Continuous Integration and Flex (Brian LeGros, Highwinds)
Spring & BlazeDS Integration (Jeremy Grelle, SpringSource)
Mate Flex Framework (Laura Arguello, ASFusion)