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!

Thursday, April 29, 2004

Amazon.com reviews of Tapestry In Action

The on-line reviews of Tapestry in Action at Amazon.com are really quite nice; very positive but also fair. As I've stated before, everyone wants something different out of the book ... for example, should there be more of a comparison to other frameworks? I think not ... the book was already too big, and there's books on that exact subject already.

I gave away many copies of the book this weekend at the No Fluff Just Stuff conference ... I hope a few of those people (you listing Bruce and David?) might have a chance to post a review as well.

Starting on Tapestry 3.1

I've been putting this off ...and I have many other things I could/should be doing. But before it goes any further, I need to move my refactorings of Tapestry out of the branch and into the head. Most of the refactorings concern classes that were moved from Tapestry into HiveMind. It's going to be a mess to put humpty dumpty back together again at this point.

Meanwhile I've very happy with how the Simple Data Language has turned out. I've been converting documentation and examples. HiveMind will support both formats indefinately. The debate still rages, though, and its boiled down to: declarative vs. procedural. I prefer the former, and I'm waiting for folks like Harish to come up with some form of design to support the latter. To me, the scriping/procedural approach looks harder to read. The SDL format is, I think, quite natural.

Finally, on the iTunes/iPod front I continue to be quite happy. The new "party mix" mode seems to work quite well, and I love the way iTunes merges songs together.

Monday, April 26, 2004

Let's boil the ocean: Simple Data Language

I'm having some fun today thinking about how to get the XML out of HiveMind.

I've long defended the use of XML inside Tapestry (and HiveMind), because it was a convienent, standard way to store hierarchical data. But it is hard to type, hard to read, hard to edit and has some challenges to parse. So I'm thinking about other options.

So ... I still want elements and attributes and nesting, though I don't actually care about nested character data. Nested character data is for documents, not hierarchical data files (despite the fact that Sun's DTDs never use attributes, just character data).

What I have so far (a couple of hours hacking around) is something small and simple. An element is a name. It may be followed by a list of attributes inside parens. An element terminates with a semicolon, or uses curly braces to denote nested elements. Attribute values don't have to be quoted if they look like identifiers, or are numeric literals. Looks something like:

module (id=foo.bar.baz version="1.0.0")
  service-point (id=Startup interface=java.lang.Runnable)
    create-object (class=foo.bar.baz.StartupImpl);

Of course, use of whitespace is totally at your discretion. For comparison, the equivalent XML document:

<?xml version="1.0">
<module id="foo.bar.baz" version="1.0.0">
  <service-point id="Startup" interface="java.lang.Runnable">
    <create-object class="foo.bar.baz.StartupImpl"/>

This is a chance for me to look at JavaCC, a common tool for writing language recognizers and parsers. Good experience in and of itself.

On the other hand, it may be smarter to follow others and simply implement the similarily themed YAML -- YAML Aint Markup Language. When I gave a HiveMind presentation a few month's back at a local Java user's group, I was asked about YAML then, and had a vague understanding of it. YAML has a few more features, better mimicing most (if not all) of XML.

I think the YAML version would be:

--- #YAML:1.0
  id:          foo.bar.baz
  version: 1.0.0
  - service-point:
      id:                Startup
      interface:     java.lang.Runnable
      - create-object:
         class:              foo.bar.baz.StartupImpl 

For either of these two formats, it would be straight-forward to create a filter that produces equivalent XML.

What a week!

So, on short notice, I traveled down to North Carolina to do two days of Tapestry training and mentoring for RoleModel Software. This was a really great experience for me ... RoleModel is a very dynamic group. When they like something, they really let you know. RoleModel is headed up by Ken Auer, an early, vocal proponent of XP (having writing at least one book on the subject). RoleModel is all virtual, it's Ken and a bunch of sub-contractors ... but these guys are pretty darn sharp. In addition, a couple of the junior members are apprentices ... one is still in high school. I've been dubious about pair programming, but it was interesting to see it in action. Their layout is one computer per pair, but with duplicated monitors, mice and keyboards. Anyway, the whole arrangement really resonated with me when I later listened to Dave Thomas' session at NoFluffJustStuff, because it is wrong to treat people at radically different levels of experience identically. Dave identified five levels of experience. At RoleModel, you could see this in action, as the apprentices would work with more experienced folk a level or two above them on the ladder.

I even tried my hand, helping Ken work out how to use the Tapestry Tree component. He was doing a lot of typing, I was doing research and writing down diagrams to understand how the Tree's data model works. Even with two deeply experienced coders, it was working surprisingly well (but we only had an hour to try this). It's important to keep an open mind.

Back from North Carolina Thursday night, on Friday morning I picked Erik Hatcher up at Logan airport and we hooked up with a bunch of other folks for the Boston NoFluffJustStuff event. We were largely scheduled opposite each other so I didn't see him present at all. I did attend David Geary's sessions on Java Server Faces. Good, clear presentation, ambitious if awkward technology. I did learn that at least some folks on the JSF committee are aware of Tapestry ... and I promised him that I'd be raising the bar ever higher. I also gave him a copy of the book (he's going to send me a copy of Core JSF when it is published).

I also attended a session on Groovy. Groovy is a mix of Java, Python and Ruby. It's a scripting language ... but it compiles directly into Java bytecode. Types are optional. It has closures (like Ruby). It adds methods to existing JDK classes like String and Collection. You can completely mix and match Java code and Groovy code. Richard did a great job of describing the language (and even identifying its faults), though the consensus was that he should have fired up a window and just typed the examples live, rather than use slides. The fact that Groovy is in the Java Community Process is odd ... since it is so compatible with Java, there doesn't seem to be a need. Even so, once it stabilized (and if it doesn't go into kitchen-sink hell), I can actually see using it for real code inside Tapestry and HiveMind. I did have a few ideas, and Richard encouraged me to join the mailing lists.

Those were the only technical sessions I attended; however Bruce Tate's session on simpler, faster, better Java was fun. It fits in with my own philosophy (and I'd like to see Tapestry and/or HiveMind as another example, beside Spring, WebWork and Hibernate). This was a continuing (and occasionally divisive) theme all weekend ... J2EE as the enemy not the solution. My philosophy is obvious on this blog:

  • Use only what you understand / cherry pick what's necessary
  • Use simpler solutions, don't buy into the whole stack
  • J2EE APIs are just starting points; don't build directly on the metal ... add a layer between

The other great, non-technical session I attended was Dave Thomas's session "Herding Racehorses and Racing Sheep". He's a great, entertaining, dynamic speaker but also well researched. The session was any number of things; what's wrong with our industry, how to cope with outsourcing, how to advance in your career properly. Some of it tied back to my earlier experience with Ken Auer, since his team is doing at lot of what Dave was preaching.

I did three sessions, 90 minutes each, all on Sunday. During the Tapestry intro ("Building Web Forms With Tapestry") Erik was there to help field questions. I also gave away a copy of the book, which went over quite well. It was pretty lively and, based on the session evaluations, quite well received. I do want to try more of Erik's approach, whereby I develop parts of the application live and rely on pre-written slides less. First I have to figure out my problem's with Jay's projection monitors (currently, I can get it to work by extending my desktop onto it ... if I'm facing the audience, I can't see what I'm typing). I neglected to count attendance, but the room was pretty full ... maybe thirty people total.

The HiveMind session was more sparsely attended but equally lively. I think everyone in the audience had a specific axe to grind but saw how HiveMind could help them. Again, maybe a little more live, or a more realistic example, would be good.

The final session of the day was the Creating Components session ... fewer people than earlier in the day (fifteen or so ... I have to remember to count them). Complicated stuff, but people were digging the concepts. Again, live would be better ... in fact, people were very impressed with Spindle, which I used in just the last few minutes. I kept finding new features in it, while I was demoing it!

I am concerned that my sessions ran too long ... right up to the ninety minute mark. That means I'll run over at The Server Side Symposium. I think I've been so concerned about running short that I haven't accounted sufficiently for questions from the audience.

Sunday, April 18, 2004

Tapestry 3.0 Final

The final release of Tapestry 3.0 is now available. Real announcements go out tomorrow (giving the Apache mirrors time to synchronize).

Got a lot of very, very tough work planned for 3.1. Time to roll up those sleeves!

Friday, April 16, 2004

Change Proposals on the HiveMind Wiki

HiveMind, for its entire history (nearly a year now), has been an ongoing experiment. It was a chance to start a project, fresh, in the Jakarta Commons (though that's not where it ended up). It was an experiment in using Maven as a build tool. It was an experiment in test driven development (give or take), with the goal to keep code coverage over 90% (it's at about 94% right now). I've also been pushing myself to keep the documentation up-to date with every change.

But the big experiment was to try and build a new community (overalapping Tapestry's community, of course) around it. That's been a bit shakey, largely because HiveMind was up, then down for a long time, then up, then frozen, and is only in the last week that the home page and all the infrastructure is in its final location, fully operational, and ready to work.

What's exciting now is that we're using the Wiki to Design In Full View. You can see this on the HiveMind Wiki, on the ChangeProposals page.

What do I mean by "Design In Full View"? It means that we are designing new aspects of the framework on the Wiki. Not just me, but others. And it's not "Design By Committee", we are having real discussions about approaches, requirements, relative merits, costs and benefits and so forth. The end result will be a living document in the Wiki that can be referenced, or used as the basis for final documentation.

We'll see where this heads. I'm confident that we have enough smart people on the team now, and more waiting in the wings, that we'll be accomplishing some insanely great things with HiveMind.

Thursday, April 15, 2004

New England Software Symposium

So after missing a couple of speaking engagements, I'm back on track for the New England Software Symposium. Checking the agenda I can see I'm on a couple of expert panels and giving three sessions:

  • A souped-up version of my "Basic Components" presentation, now titled "Creating Powerful Web Forms With Tapestry".
  • Creating Tapestry Components
  • Introduction To HiveMind (since my Tapestry + Hibernate presentation isn't ready yet).

The best part, for me, is that I can drive to this event (it's less than an hour from my house) and sleep in my own bed.

Wednesday, April 14, 2004

Vote to release Tapestry 3.0

Just submitted a vote to release Tapestry 3.0 FINAL. Quite a few people have been demanding a release (yes, that means you, Erik) and I think Tapestry is in excellent shape to proceed forward. Not quite all my goals for 3.0 have been reached ... there's still some gaps in the documentation, and the test suite isn't quite at the level of code coverage I'd like (it stands at 81.3% overall, and should be in the 85 - 90% range). Regardless, Tapestry 3.0 is stable and more than ready for production.

The vote will run into Saturday, with an announcement following on Monday. There's a chance that one of the committers will decide that a bug is too important to wait, and will veto the release.

The team in general, and myself in particular, have really big plans for release 3.1. Everyone's hot button item is modularity ... in 3.0, all your page specs go in WEB-INF and all your page templates go in WEB-INF (for some people) or in the root folder (for me). That causes two problems. First, those directories can get crowded when you have dozens or hundreds of pages (especially when you add in messages files and other assets to the mix). Secondly, J2EE prefers that you split your application across folders, because it (effectively) applies declarative security at the folder level. Therefore, you want to be able to put all your administrative pages, with access restricted to an admin group, into an admin folder.

This will require a bit of a rethink on how Tapestry generates and interprets URLs, and likely, some significant changes to the IEngineService interface.

The other significant change relates to component parameters; I would like to deprecate directions "in", "form" and "custom" and always use (the equivalent of) direction "auto" ... but add in hints that determine how long values can be cached. That is, once you evaluate an OGNL expression, is the value valid just while the component renders, until the page finishes rendering, or until the end of the request? I have a rough mental outline of how this all will work, and it's going to be a lot of fun with Javassist. Components will have to know when they start and finish rendering, whether parameters are bound, whether they are bound to invariants or to expressions and so forth.

That, combined with Drew's upcoming improvements to OGNL should be very exciting. Mind Bridge has profiled Tapestry applications and they can spend around 50% of their time evaluating OGNL expressions. The majority of those OGNL expressions are simple property references. They're working on a plan to make use of Javassist to replace reflection with direct method invocations where appropriate, and Drew's seen about a 10x improvement.

This leads me to the following prediction: In Tapestry 3.1, Tapestry applications will be significantly faster that servlet, JSP, Struts or JSF applications with equivalent functionality. Of course, it's pretty much impossible to find applications with "equivalent functionality", but none the less. By improving the efficient of OGNL, and making use of the optimizations possible because of the Tapestry component object model, I believe the overall processing (especially with respect to Java reflection) will decrease noticeably.

Now if I only had my own personal performance lab ...

Tuesday, April 13, 2004

Two new toys

This is way off topic, but I couldn't resist.

Toy #1

Bought myself a 15 gig iPod. Basically, this is me throwing in the towel on even trying to do work on my laptop while I travel (and I have a lot of travel coming up in May). Since I find the tedium of air travel to be agonizing, this is my hi-tech pacifier. And I'm already in love with it. I've already moved about 1.5 gig of MP3s onto it (all legit, by the way) and it works like a champ. Eventually I'll compare it's native AAC format.

It came in a perfect black cube (something of a Steve Jobs trademark) and every aspect of it so far has been done right ... except I can't get it to charge off my laptop's firewire port. Another plus: the visualizer for iTunes (the desktop program) is a licensed version of G-Force. I guess it's time to uninstall MusicMatch.

Amazingly, I ordered this from Apple at the set-price ($299) late in the afternoon on Sunday and it arrived here this morning (Tuesday!) and it has been custom engraved. And it was shipped FedEx from Shanghai! Oh, if you find an iPod at some airport engraved with "Howard Lewis Ship howardlewisship.com" ... that's mine. Give me a call so I can get it back!

Apple knows how to do these things right. Easy to use, and I keep finding new features. Sound quality with my Boise noise-canceling headphones is terrific. I'm ready to travel anywhere.

Toy #2

This one's virtual ... it's the Google AdSense banner over on the right side of this page. I rather doubt I'll drive enough traffic to earn more than some spare change but to me it's fascinating how it scans the content of the page (presumably from Google's cache) and produces pretty on-target ads. I'm slightly annoyed by the Struts and JSF training ads I've seen on a few of the archive pages, but so be it.

Thursday, April 08, 2004

TheServerSide Java Symposium Schedule

I was just looking at the TSS Symposium schedule. I'm up twice on Thursday, May 6th: HiveMind from 11:30 to 12:45, and Creating Tapestry Components from 3:30 to 5:00.

That leaves the question of which other sessions to attend! It will be a chance to learn more about AOP, and I want to see Gavin King's presentation on Mobile Data. It will also be a chance to learn a bit more about Porlets OR JBoss Cache OR J2EE without EJB (all scheduled against each other, alas).

The dinner keynote by JBoss, on "Professional Open Source" will be interesting. Will they be able to come up with a useful definition of this term?

I'm also interested in the Macromedia presentation on rich clients. At some point, (two years? five?) HTML applications will be marginalized, and some form of rich client within the web browser will take over. You won't do so much HTML, but you'll still need HiveMind to implement the server side of your application.

Wednesday, April 07, 2004

Many pots coming to a boil

So, HiveMind after months and months of being left out in the cold, is finally turning into a real project again. It's a top-level Jakarta project, all of its infrastructure is in place, and the home page is now working (without all the broken links). I've also moved the model attribute out of the <service-point> descriptor element and into the <invoke-factory> and <create-instance> elements (which makes a lot more sense).

Tomorrow will be the next Tapestry release, 3.0-rc-3 (that's "release candidate #3"). I'm really expecting this to be the final release candidate ... but you can never tell.

Time to shift my attentions (and growing energies) back to important things: preparing for The Server Side Symposium and NoFluffJustStuff (big revisions necessary for my presentations --- to reduce the amount of fluff!) and otherwise preparing for upcoming public and private sessions about Tapestry.

Tuesday, April 06, 2004

HiveMind up and humming!

We now have an empty Wiki, the full set of mailing lists, the new home page, and the Jira project. Time to get back to work on HiveMind.

Still need all the developers voted in to the project to get their CLAs to Apache before CVS access rights can be extended. Knut? Prashant? You guys listening?

Monday, April 05, 2004

HiveMind Home Page

The HiveMind home page is now up, in its proper location: http://jakarta.apache.org/hivemind/.

This is about half the infrastructure for HiveMind. The Jakarta Jira project has been created, and the CVS repository is in place. All that's left is the wiki and the mailing lists.

Friday, April 02, 2004

TheServerSide.com - Review of Tapestry In Action

The Server Side has just posted a short Review of Tapestry In Action. It is interesting (and frustrating) that every reader wants something completely different from the book. This review is reasonably accurate (through I wish Kris, the author, had used a spell checker). He faults the book on the one hand for being verbose ... then praises it on the other for being detailed. His summation is to read the first two chapters to decide if you like Tapestry, then keep the rest handy for when you implement an application. Not bad advice.

Thursday, April 01, 2004

Berkeley DB Java Edition

My pal Greg work for Sleepycat Software, who just released Berkeley DB Java Edition. Berkeley DB is some cool technology; quite a few popular sites use the C version of Berkeley DB in their presentation layer (in fact, Berkeley DB is used in a huge number of places, including Subversion), as a cache against raw data stored in Oracle or a backend system. It's anything but a relational database ... its a high-performance, transactional, embedded database. It's a way of storing large amounts of binary data, which just might happen to be serialized Java objects.

The Java Edition adds a Java-friendly API ... Berkeley DB databases end up looking like Maps and other Java collections. Or you can get more down and dirty and control exactly how objects are serialized into, and de-serialized out of, Berkeley DB entries.

There's a lot of talk about J2EE without the complexity of J2EE, thus things like Spring and HiveMind ... the sacred cow of EJBs (both session and entity) fall away when you find a different, better way to organize and componentize your code. Most of us still assume that the only way to store our data is in a relational database, and then get involved in an Entity EJB vs. Hibernate vs. JDO vs. TopLink battle ... when, in many cases, all we want is a simple way to store and retrieve Java objects. The relational database becomes an assumption, somehow evading questions of cost (of licensing, of adminstration, of maintenance, of hardware), use cases, requirements ... it's another sacred cow waiting to be slain. If you are creating a typical application, where the application itself is the only use of the database, then an embedded database may be the better, faster, more efficient, cheaper, zero-administration approach.

"Tapestry In Action" in bookstores

Just called over to the local Barnes & Nobel and they claim they have Tapestry in Action in stock; time for a little field trip (and I'm bringing a camera). Times like this really make me feel the need for a digital camera.

I also understand that a review of the book will be appearing soon on TheServerSide.

Meanwhile, Tapestry 3.0-rc-2 is ready (a formal announcement will wait for 24 hours, for the many Apache distribution mirrors to pick up the new distro files). In addition, I'm waiting for the HiveMind infrastructure to be set up: for some reason, this is taking a while.

I've continued to play around with Hibernate; I really want to get some good patterns and best practices together, both for presentations at NoFluffJustStuff, and as part of my on-site presentations. I don't know that I'll have the Hibernate stuff together in time for the New England Software Symposium, however. I'm having trouble getting started and staying focused (not surprising for someone who had his kidney removed just 16 days ago).

Update: Barnes and Noble had a copy in stock (but misfiled with the HTML books, so I moved it to the Java section myself). Borders didn't have a copy yet, they were expecting it in the next day or so. Still, it was a fun rush to see the book in a book store! In addition, the HiveMind infrastructure tasks are finally in progress. Should have a new and better HiveMind in place today or tomorrow!