Pushing the envelope

Darren's take on Java, agile methods, cool open source stuff, interesting technologies and other random wanderings through the land of blog.
Updated: 26/01/2003; 11:49:34.
Places to go
Apache Jakarta Project
c2.com
ExtremeProgramming.org
OpenSymphony
XProgramming.com
XP Developer

People to see
Russell Beattie
Eugene Belyaev
Tony Bowden
Mike Cannon-Brookes
Jeff Duska
Paul Hammant
Scott Johnson
Brett Morgan
Rickard Öberg
James Strachan
Joe Walnes

Things to do

Subscribe to "Pushing the envelope" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.


That was the day
August 2002
Sun Mon Tue Wed Thu Fri Sat
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Jul   Sep



Archives
December 2002
November 2002
October 2002
September 2002
August 2002

Listening To


Valid RSS

Click here to visit the Radio UserLand website.

  28 August 2002

2 open source projects that could be worth looking at...

beanutils from Jakarta contains heaps of useful utility methods for working with beans, introspection etc. There's also something support for DynaBean objects, which are like dynamic beans that can be defined at runtime. They make a neat wrapper around regular java beans too so you can access them in a Map-like manner.

Jexl is cool, its a simple expression language for evaluating expressions on beans. Jexl is a little like the Velocity expression language and is a super set of the JSP Expression Language. So you can use it to navigate bean property trees, accessing maps, arrays, collections, indexed properties and 'map properties' (a term coined by the beanutils project for getter methods that take a String argument) as well as methods. So the following are valid Jexl expressions...
[James Strachan's Radio Weblog]


I looked at the beanutils stuff. I'm actually working from the other direction, grabbing all the properties from a bean and iterating through them looking for placeholders in the HTML that match each property name. That seemed easier than parsing the HTML and looking up properties on the bean. It should also make it easier to add user-defined markup - the code just does indexOf(openingMarkup + propertyName + closingMarkup) and replaces it with the property value. I wanted something that was 'developer-driven' - so the natural direction to go in seemed to be to emphasise the model acting on the view, rather than the other way around. Performance may be an issue, I have no feel at all for the performance of introspection and repeated calls to indexOf. I'm deferring worrying about that!

6:17:38 PM      comment []

© Copyright 2003 Darren Hobbs