Helma Logo
main list history
previous version  overview  next version

Version 5 by hannes on 12. August 2006, 01:04

The purpose of this page is to describe how all the features in Helma 1.5 will be implemented in Helma 2. Some features will be implemented in Helma core, while others will be implemented as JS libraries, extendsion extension or modules.

== Code Layout Compatibility ==

One frequent request for Helma 2 is to make it behave and look more like ordinary JavaScript, and do less magic behind the scenes. This clashes with the desire for Helma 1 backwards compatibility. The plan is to not implement Helma 1 compatibility in Helma 2 core, but provide simple means to enable Helma 1 style code layouts from within the application.

Let's suppose the default way to define HopObject prototypes in Helma 2 uses a syntax similar to the one embraced in *this demo implementation|JavaScript Inheritance Sugar*:

  MyObject = HopObject.extend({
    foo: function() {
      ...
    },
    bar: function() {
      ...
    }
  });

Then all that is be needed for using a Helma 1-like code layout is an evaluate function that understands "*" wildcards and takes an optional object to evaluate on as second argument (default is the global scope):

  // define extended HopObject prototypes/constructors
  Root = HopObject.extend();
  Weblog = HopObject.extend();
  WeblogItem = HopObject.extend();
  
  // optional: mount Helma 1.* code repository to namespace "henso"
  addRepository("/usr/local/apps/henso", "henso");
  
  // map code to HopObject prototypes
  evaluate("henso/HopObject/*", HopObject.prototype);
  evaluate("henso/Root/*", Root.prototype);
  evaluate("henso/Weblog/*", Weblog.prototype);
  evaluate("henso/WeblogItem/*", WeblogItem.prototype);

== Host Objects ==

=== req ===

Implemented *in Helma core|Source/helma/trunk/src/org/helma/servlet/ScriptableRequest.java* with additional features and properties, fully scriptable through Request.prototype.

=== res ===

Implemented *in Helma core|Source/helma/trunk/src/org/helma/servlet/ScriptableResponse.java* with additional features and properties, fully scriptable through Response.prototype.

=== session ===

To be determined. Check lazy session creation and integration with Servlet session support.

=== app ===

To be determined.

=== path ===

To be determined, depends a lot on *request path mapping* implementation.

=== HopObject ===

==== Persistence Support

Implemented as Java module. For integration into Rhino see *Helma 2 HopObject Implementation*.

==== Prototype folders

May be implemented using a include(dir, prototype) feature that evaluates scripts in the given directory on the given object prototype. Thus, Helma 1 apps would require a simple js file with includes for all prototypes to run on Helma 2.

     removed
     added