Helma Logo
main list history
previous version  overview  next version

Version 3 by hannes on 15. January 2008, 12:21

This is a comparison of *JSAdapter* *JSAdapter|http://blogs.sun.com/sundararajan/entry/self_javascript_and_jsadapter* and *JOMP**JOMP|http://www.bias2build.com/thesis/javascript_mop_expanded.html*, two approaches to add metaprogramming features to Rhino.

=== JSAdapter

* Inheritance not as easy. Normal use needs wrapped object, but for prototype in inheritance chain we need unwrapped adaptee object, so we need two constructors.
* getDefaultValue is forwarded to the adaptee object, so a toString() that relies on adapter functionality won't work.

=== JOMP

* Adds a burden to all property access methods of the default JS object.
* Not thread-safe, and making it threadsafe will put an even bigger penalty on the default JS object.

=== Test code

This is a script that implements a base and extended object using both techniques, and a patch for adding JOMP support to Rhino.

<% this.attachments %>