Thursday, January 8, 2009

Flex 3s biggest failing - Silent Failure

Now, I've been doing a lot of programming in Flex lately.. Way too much, 80 hour weeks, and I'm getting pretty familiar with it.

The one thing that really kills me is it's major weakness, which stands out in sharp contrast to Java, which AS3 obviously aped in some ways. I've been doing my server backend in Java with Spring, Hibernate and BlazeDS, which is a winning (although a bit complex) setup.

The biggest weaknesses of Flex 3 are Silent Failure and Lack of Feedback.

When something fails in Java, if you've got your logging setup correctly, you generally see why, and exactly where. In Flex, most of the time it doesn't tell you.

A couple of examples from just today:

  1. I have a CRUD tool for my games backend data, and after performing some surgery on one of my data structures, I had broken a section of it and had to make some changes. No problem, I make the changes and... It now refuses to save any of the objects. The save is basically a remoteObject call where I send the new objects in a hash structure to the server. The Flex code gets all the way to the remote object call and then in there somewhere, just silently fails. Even in debug, no trace, no nothing - the server just never gets the request. I found it of course, after some hair pulling, but Flex was no help whatsoever.
  2. Passing some objects back from the server, some of them were untyped. I've run into this before, and of course it doesn't tell you WHY they are untyped, so I checked the usual suspects - yes, it has a RemoteClass metadata tag, yes the namespace and class names are correct, yes, yes, yes.
It was a semicolon. For instance:

[RemoteClass(alias="com...snip..DTO")]; <-- That
public class SkillCheckDTO

That semicolon, put there as I was programming this morning half awake, will cause Flex to just not type that object properly with no error.

Programming in Flex (and to some extent Java with some of the OSS stuff I am using) is a little TOO much like the bad old days of programming on the Amiga, where my software tools generally had no documentation and the documentation they did have was wrong, so I had to figure it out by trial and error.

And don't even get me started on the controls and databinding.

Compiling - no feedback whatsoever. I want to see WHY my compile is taking so long (although it's much better now). Where's the verbose compiler output?

If there's one thing they need to fix for 4, this is it. Overload me with optional information. I want to see everything you're doing, so that when it invariably breaks, I know why.

1 comments:

  1. very good post!

    How did you nail down the RemoteObject silent failure? I have a similar problem, and debugging didn't get me anywhere. I'm explicitly blocking the request with Charles, and Flash appears not to have any feedback mechanism in place to handle that situation...
    ReplyDelete