Rob Gordon is a seasoned Java developer and a big fan of open source. Oddjob is his own open source project to make job scheduling and task automation in Java much much easier. Rob is based in London. Rob is a DZone MVB and is not an employee of DZone and has posted 17 posts at DZone. You can read more from them at their website. View Full User Profile

Oddjob 1.2 New Features – Part 1

07.19.2012
| 2254 views |
  • submit to reddit

It’s coming to that time again. That time where I draw a line in the README file and call it a release. Being the only developer on a project that doesn’t have a large user base, a release is really just a state of mind. Like the flying ants that decide on mass to pour forth from their nests without the aid of any social media – it becomes time for a release.

The desire to release, to mark achievements and to demonstrate progress to the world is compelling but it is tempered by the chores a release involves – update the doc, double test everything, and resist the urge for that one last killer feature.

As I force myself down the home straight, I thought I’d share some of the cool new features in Oddjob 1.2, starting with…

Dynamic Form Generation for a Bean.

For several Oddjob versions now, if you provide an element mapping for a bean,
Oddjob will dynamically create a form for you based on the writeable properties of that bean.

Here’s one such example, it’s the design form for check job. Check job checks
a value against one or more conditions. The properties might not be in the most helpful order – but better than XML alone.

Designer for CheckJobPreviously however, when configuring an adhoc job using the bean element, the user was just presented with Swing’s basic text area where they could enter some XML. In Oddjob 1.2 there is now a field for a fully qualified Java Bean class name.

Bean Designer No ClassOnce the class name is provided, Oddjob will generate the form. Here’s java.util.Date,
with all its deprecated setters!

Bean Designer With DateFor those that like to see XML, Ctrl-T toggles back to the boring old text area.

XML Designer With DateAnother small enhancement is that the design is parsed before before the designer window is closed. Enter ‘june’ in the month field and click OK to write the design back to Oddjob and you get

Design Parse ExceptionIn Oddjob 1.1, the error was reported without the stack trace, but only after the designer had closed so the configuration was lost! Although I got into the habit of using notepad as a backup when making large configuration changes, this ‘feature’ still caused me endless irritation.

Oddjob Designer’s forms are still quite crude. Everything is text fields and Swing’s GridBag layout contributes it’s usual resize quirks, and there is no undo! However, I hope this new small feature provides a small tranquil clearing in the XML configuration jungle.

Published at DZone with permission of Rob Gordon, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)