HOWTO improve Helma 1.x
I am currently working on improving and extending Helma 1.x. This page serves as a public todo list summing up tasks that should be or could be done (but are no bugs) to improve Helma 1.x.
- HopObject
- HopObject.forEach() should behave exactly like rhino's Array.forEach http://dev.helma.org/bugs/show_bug.cgi?id=537
- deprecate either count() or size(), I'd prefer to deprecate count(). simon: would prefer collection.length (mimic array)
- deprecate invalidate(id), as it can be done as get(id).invalidate()
- rename the magic properties (__id__, __parent__, ...). Some properties currently exist with one underscore in front (_property) as well as with two in front and two at the end (__property__). Some only use one syntax, some are case-sensitive, some others are not.
- move getById(id, proto) to app.getById(proto, id) or remove it as it is unrelated to the HopObject called on, leave Constructor.getById(id) as it is.
- rename getChildElement to onGetChildElement to reflect that it is an event handler
make getOrderedView() return something else. Currently it returns some object that is similar to a HopObject, but is not a HopObject. Some functions are missing, some throw an "unsupported exception". There should be something like a HopCollection, being extended by HopObject.- some functions like getOrderedView() throw RuntimeExceptions when called on an incompatible (transient) HopObject, some others just return null. I propose to change all functions to throw exceptions, as one can check with isPersistent() before doing a call that might not be supported.
- Properties files
- As every other directory or file is configurable, the location of the db.properties file should be too. I'd suggest to add dpPropsFile.
- Scripting engines
- Implement a configurable class shutter implementation for Rhino
- Move configuration properties only influencing a specific scripting engine to it's own properties file (i.e. have separated configurations).
- POST/GET data
- queryParams, postParams very long. rename to smth shorter like res.GET and res.POST (uppercase would also hint their immutability)
- remove res.data. we should encourage clean seperation between POST/GET data
- even more so if http-method-routing / REST catches on (also see http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.1, and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html )
- http://dev.helma.org/trac/helma/changeset/9671
Comments
I think this is a great idea and am happy to help.
It would be great if we could also put the bugzilla IDs next to each item on this page...
I'd prefer size() since I use it rather then count() in all my existing apps.
Would also be good to have getOrderedView() work with sorting by child properties as currently its quite limited. Perhaps it would be better to rework it to be more generic sorting interface.
Would also like to propose the following for the DB/ORM layer:Note that as of Helma 1.6.3, getOrderedView returns a transient HopObject: http://helma.org/bugs/show_bug.cgi?id=534