Helma apps without the HopObjects

5 views
Skip to first unread message

Hannes Wallnoefer

unread,
Dec 18, 2008, 7:52:58 AM12/18/08
to Helma
It occurred to me today that there are two ways to define the object
hierarchy for a Helma 1 application: Either use HopObjects (persistent
or not), or wrap Java classes using the class.properties file. Both
make use of the HopObject prototype directory structure. What's
missing is a way to build applications avoiding the whole HopObject
directory stuff, using nothing but the pure and simple global
JavaScript scope.

It turns out that this was easier to implement than I thought, and so
starting today you can write Helma 1 application with no HopObject
prototype folders at all. The key is to define a
rootObjectPropertyName property in app.properties with the name of the
global JavaScript property you want to use as root object. From there
on, everything spins out using the familiar getChildElement() scheme.

I uploaded a simple demo app: http://groups.google.com/group/helma/web/purejs.zip

Right now, you loose the complete HopObject functionality: No
persistent objects, no skins and functions associated with objects,
etc. In exchange you are free to manage your own code and structure
applications any way you like (note that you can have subdirectories
in global, all nested content will be treated the same).

Potentially, we could gradually add code to implement HopObject
functionality to pure javascript objects, using the available java
code. I'm not sure if there is interest for that, but it would be an
interesting path.

hannes

Hannes Wallnoefer

unread,
Dec 18, 2008, 9:07:27 AM12/18/08
to Helma
I now added an analog rootObjectFunctionName property that allows to
set the function Helma will invoke to get the root object. Thus,

rootObjectFunctionName = getRoot

will result in global function getRoot() will be called to get the
root object.

hannes
Reply all
Reply to author
Forward
0 new messages