Helma Logo
main list history
previous version  overview  next version

Version 2 by hannes on 15. January 2008, 12:18

This is a comparison of *JSAdapter* and *JOMP*, 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 a burden 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 %>