Tapestry Training -- From The Source

Let me help you get your team up to speed in Tapestry ... fast. Visit howardlewisship.com for details on training, mentoring and support!

Saturday, February 19, 2005

Life is a blur

Just did a whirlwind trip to Utah to speak at the Utah Java User's Group. It was a fun trip, and a great crowd. Jamis Buck warmed them up with a great demo on Rails.

This was a good change from my last couple of Tapestry sessions; a much more dynamic crowd (numbering well over a hundred), asking useful and challenging questions. I got some good feedback that I hope to incorporate into my upcoming TSSS and NFJS presentations. Basically, rather than explain some of the details of validation poorly, I'll explain it briefly and omit a lot of details.

Also, I had some better ideas for the table component demonstration. Rather than "address book", I think I'll do, "iTunes inventory". I can then highlight rows that have my highest rated songs.

I was busy on the flight out and back. I've added to HiveMind something new and desired ... the ability to use pure POJOs as services ... POJOs without interfaces. This took a little doing ... the internals of HiveMind are specifically geared around interfaces (not just for interceptors, but for all the proxies that control just-in-time creation).

What I did is generate a synthetic interface for services that are really beans. The interface contains all the public methods that aren't inherited from java.lang.Object. The synthetic interface also extends any interfaces implemented by the bean. This seems to work quite well; I started up a vote to release HiveMind 1.1-alpha-2 to get this out into the field and see what works and what doesn't.

It's a little odd that the interface attribute of the <service-point> can now be a ordinary class (not an interface). This does create a split internally ... there's the declared interface (which may be a class) and the service interface (which either matches the declared interface, or is synthetic).

I also added a very simple, light-weight initialization to the instance: object provider. You can now specify, in addition the class name, a list of properties and values. The values are converted from strings to the property's type and assigned. It's using pretty much the same techniques as the smart translator. In fact, just writing this blog entry, I realized a bunch of other places this can and should be used.

Finally, I did some work on Tapestry; adding unit tests for components. This is long overdue; we need tests before we can start doing some of the big improvements with respect to form handling and input validation that are coming down the pike. I started small, with Insert and Conditional. Even so, I found some gaps in the coverage that aren't covered by the integration tests. Eventually, I hope to get rid of all the existing integration tests and replace it with just unit tests and handful of "sanity check" integration tests.

No comments: