Friday, July 22, 2005

R.I.P. Red Boxes

WARNING: This blog entry was imported from my old blog on blogs.sun.com (which used different blogging software), so formatting and links may not be correct.













One of the really nice things about Creator and JSF is that we're able to provide WYSIWYG editing of components.
We do this by actually running the components' renderers at designtime. This does however have one problem: What if
the component renderers aren't happy?



Lots of things can go wrong. For example, let's say you have a databound JSF table. If you kill the database connection,
the component renderer will abort with a SQLException. Incorrect expression language bindings, missing converters and
a whole host of other potential problems have similar issues.




How do we handle this in the IDE? In Creator 1.0, we had the "Red Boxes" scheme, as shown in the first screenshot on the right.
In the designer, components which aborted during
rendering would be shown partially (as much as possible depending on how far along the renderer got before dying),
but all the markup would be changed to have a red background. That way you could
sort of see the component if it had rendered enough before giving up. This is better than not showing the component at
all, since (1) it makes it really obvious that there is a problem, and (2) it makes the troubled component easy to select so you
can inspect the property sheet and try to fix the problem. We also opened the Output window with an error message trying
to explain what had happened, and what to do about it.



In Creator 2 this behavior has changed. Instead of the red boxes, you first get an error screen (similar to the one you
get if you introduce parsing errors in the JSP, or syntax errors in the Java file). This error screen includes portions of
the stacktrace, which in many cases might reveal what the problem is (don't forget to look for a cascaded exception1)



You can also click through to the
design view, and now you'll see the component. However, rather than an ugly red box you'll see a small error icon in the
component's place along with an error message associated with the render problem. It should also be much better about
not repeating the error screen until you've resolved the problem and encounter a new problem (although there was a bug
in this area fixed shortly after EA).































2 comments:

  1. Tor, it would be really useful as a developer if I had som sort of ETA on when Creator 2 will go gold. I'd like to plan product development around this event and at least an estimate would be helpful. Is this against Sun policy? I'd hasten to add (IMHO) that, if it is, such a policy is not helpful to a developer ecoystem that would rely on such data. Lotus/IBM, for example, is quite straightforward in their pipeline scheduling, which makes planning much more predictable.

    ReplyDelete
  2. Hi Jake,
    Our current target for the Creator 2 release is within this calendar year.
    But 'targets' are goals, not commitments, and we're still reacting to the feedback from the early access, so it's possible we'll ship later if we conclude that's the right thing to do.
    Hope that helps,
    David Folk
    Product Line Manager
    Sun Java Studio Creator

    ReplyDelete