JavaScript's dynamic nature supports a simple principle, such that a call to an object-method can cause other functions to execute as 'prefixes' and/or 'suffixes' to that method. From the point of view of callers and callees, such redirection of execution occurs transparently, and this technique is called Method-Call Interception or 'MCI'.
Augmenting function-calls in this way permits the aggregation of functionality, while existing, proven code remains undisturbed, and MCI therefore offers significant advantages. Developers can implement applications in a more modular, efficient and reliable manner, and it is this principle that underlies Aspect-Oriented Programming.
This technique is possible on a proprietary basis, but beyond the simplest case, matters become complex, challenging and error-prone. It follows that the solution is a pre-built library that corrals the technicalities, and AspectJS is that resource.
Affording full control over the application and management of interceptions, it allows you to concentrate on the design and implementation of technology that matters, while benefiting from the AOP approach to programming.
Comprehensive and robust, AspectJS is the finest technology in its class, and proffers huge benefits to JavaScript developers. Moreover, version 1.1 now improves on previous releases greatly to deliver power with reliability, elegance and efficiency.
| Simple |
The core technology comprises a singleton JavaScript-object supporting just four methods. Application of a given 'affix' function returns an object to client code, thus allowing complete control of that affix. |
|
| Powerful |
Interceptees can possess multiple affixes, with fine control over lifetime and execution order. Affixes receive their interceptees' arguments when invoked, while suffixes also receive their return values. Client code can also stipulate a static argument to be passed to a given affix upon its invocation. |
|
| Efficient |
A sophisticated, modular design allows developers to disable unwanted features - and thus their overheads - when deploying a system, such that only the AJS object - just 9.68k when minified - need be transmitted to the client. |
|
| Safe |
A single, optional call traps all bad or missing arguments passed to AspectJS methods thereafter, and a similar call enables logging of the library usage, thus aiding in development and debugging. |
|
| Sound |
A lack of undocumented methods, and an advanced implementation preclude compromise by inept, lazy, or malicious developers. Moreover, AspectJS populates its enclosing scope with just three objects - two of which are optional - thus reducing the potential for name-conflicts to a minimum. |
|
| Independent |
Implemented purely in ECMAScript v3.0, AspectJS references neither 'native' nor 'host' objects, and therefore operates on any platform that supports JavaScript, not just web browsers. |
|
| Proven |
Firefox |
|
Product Version: 1.1
API Doc. Version: 2.00
Tutorial Version: 2.00