In this respect, I really like the way helma handles REST style
architecture (Though I think it could be pushed further).
URL's in helma are automatically mapped to an object graph in your
program. 1:1, url:object, it's very tidy. For more dynamic sections
of an application, you can override an object's "getChildElement"
function, to return an object based on the suburl.
For instance
example.com/pages/1/ would return the first page....but
PageManager.js:
function getChildElement (name) {
return this.pageByUrlsafeName[name]
}
and then you can do
example.com/pages/rest-and-javascript/
then once an object is resolved to resemble what might traditionally
be viewed as a "directory", the "files" are mapped to methods on that
object
Page.js:
function main_action () {
this.renderSkin("main");
}
function edit_action_get () {
this.renderSkin("edit")
}
function edit_action_post () {
this.title = req.postParams.title;
this.renderSkin("edit");
}
and so on, making the urls
example.com/pages/rest-and-javascript/
and
example.com/pages/rest-and-javascript/edit
and mapping different behavior to GET and POST actions of that url.
I think helma could go further in making this object graph a bit more
dynamic. As it stands, one must construct the object graph
declaritively, using a series of folders, .js source files, and
type.properties files which define the relationships between the
different objects (which are actually host objects).
What would be really cool is if a whole section of a website could be
generated dynamically out of a function. Or perhaps a whole website
built by specifying a few input parameters in one end, out comes a
website on the other- write the source files to disc and tweak to
perfection.
On Jan 31, 6:39 am, Peter Svensson <
psvens...@gmail.com> wrote:
> I would very much like this. perhaps like this; Even if there exists other,
> more effective ways of communicating data, having a RESTive interface to
> that sweet spot automatically would be a great boon.
>
> Cheers,
> PS
>