Val's Blog
Lots of stuff for Web 2.0 freaks and Javaholics
Feeds RSS | Atom | RDF
 
 
Alan M. Davis: "If you believe that you know the requirements better than the customer, you are part of the problem, not the solution."
[ Login ]

July 2005
SunMonTueWedThuFriSat
      1  2 
 3  4  5  6  7  8  9 
 10  11  12  13  14  15  16 
 17  18  19  20  21  22  23 
 24  25  26  27  28  29  30 
 31       
Jun  |  Today  |  Aug
XML Feeds   Subscribe with Bloglines

Javaranch Sheriff   My LinkedIn Profile
Drop me a line or two   Bloglines Blogroll
JavaRSS   Referers
How cool are you?   My Reviews

Next trips...
SpringOne 2008 (Jun 11-12, 08)
Ajax Exp. 2008 (Sep 29-Oct 1, 08)
Top 10 entries (#hits)
(As of Nov 30, 2007)


Top 10 entries (#hits/day)
Come Back (5.032)
(As of Nov 30, 2007)
Recent Blog Entries
Recent Blog Comments
Re: Review of "Marketing Management 12th"
i know marketing management by kotler is good book but the problem is that the management part of this book is totally missing as fare as i know managemet is complete different subject and it should not be mixed i am student of MBA i was looking at ass...

Re: Review of "Pro Spring"
Using simple POJOs + factories without Spring for "echo" and "counter" would be a lot more easier. No need to write those XML files... So, in this case using Spring makes me write a lot more code... (OK, you can generate everything with the help of And...

pls urgent
Hi I am trying to generate the word doc but i m not understanding wats happening any one pls figure it out /* * WordAPI.java * * Created on May 30, 2006, 10:50 AM * * To change this template, choose Tools | Template Manager * and open the te...
Archives (# entries)
Links
Other Blogs
Other Blogs

Reviewing
Reading
Locations of visitors to this page
What they once said...
 

The AJAX technology stack is gently establishing itself as a de facto standard for developing Rich Internet Applications. Though, AJAX sure needs to mature a little bit more to become mainstream and to let common usage and design patterns emerge. I recently went through an interesting blog entry on Joe Walker's blog where the author states that his current project contains 2% HTML code (~100 SLOC), 4% Java code (~200 SLOC) and 96% Javascript code (~4,500 SLOC).
(credit to Christian for providing the link)

What this tells me is that as AJAX applications will gain in popularity and be increasingly deployed across numerous academic and industrial settings, AJAX developers will not only need effective tool support for dealing with all that complexity but they would also greatly benefit from integrating technologies with proven added value, such as AOP, into their JavaScript code. I won't delve into the details of AOP now as there are currently enough resources on the web that you can read during your next 15 reincarnations.

When I look at a modern AJAX application what I usually see is lots of JavaScript code featuring functions, objects and prototypes where pretty much all concerns are mixed up. The only way of modularizing and organizing a little bit JavaScript code is by using distinct physical files that contain only related code and that can be included in HTML files when their code is needed. Period. You have actually no other choices than to mix your networking, event handling and layout concerns in the same JavaScript file. For this reason I have started writing my own AOP framework for JavaScript which hasn't been baptized yet. Then, as I was halfway through my AOP journey, I came across an interesting article that made my day on dotvoid.com titled Aspect-Oriented Programming and JavaScript, which explains that AOP support has been included into the Toxic framework. The support is still limited compared to what other frameworks, such as AspectJ, provide but in my opinion it covers 90% of the cases where aspectual code is needed.

Basically, the Toxic framework provides the following support for writing aspect-oriented JavaScript code:

  • amendment of the static structure of JavaScript code by using the Aspects.addIntroduction() function.
  • amendment of the dynamic structure of JavaScript code by using the Aspects.addBefore() and Aspects.addAfter()functions.
  • modification of the control flow of JavaScript code by using the Aspects.addAround() function.

Introduction support is pretty complete whereas it is currently only possible to define an advice on method calls and nothing else. Moreover, there is no way to explicitly declare pointcuts. As I said, this is really far from being dramatic as Toxic AOP support should cover most of our needs for now. I thank wholeheartedly dotvoid.com for including AOP support into their Toxic framework. That should get me going while I finish up my framework since I don't have any a fixed release date planned as I have to deal with a pretty hectic schedule myself.

If anyone knows of any other worthy AOP frameworks for JavaScript, please drop me a comment.

Update:
[Added the link to Joe Walker's blog provided by Christian.]

 
About this Blog