I’ve made enough progress with the migration from Flex 3 to Flex 4 to commit it to the repository. It’s not ready for prime-time yet, so it’s in a branch in case something bad happens and we’re forced to stick with Flex 3. Somehow I resolved the one-click build being broken. I’m not exactly sure how; basically instead of trying to migrate the existing project, I created a whole new project and copied over the source files and set everything up again. The build process is not as good as it was before now, in my opinion, because now there’s a kludge of Flex build and Ant build, where the Flex build handles compiling the app and copying the HTML template, but the Ant build retains its job of copying the PHP scripts. It may be possible to return to a pure Ant build, which I’d prefer, but right now, it works, so I’ve moved on to investigating other issues.
I’ve managed to figure out the new system for importing web services. It’s radically different from the old way; all of the existing code for interacting with the web service will have to be updated to work with the new auto-generated code. The good news is that this is a fairly simple process, and the new system is more intuitive than the old one. In FB3, you add event listeners to the service rather than the request call, which seems a little awkward to me. In FB4, conversely, you create a CallResponder, add event listeners to that, then attach the AsyncToken the web service call returns to it. The best news of all is that the existing web service code can co-exist alongside the new code: the only thing I ported was createCompany, which still works just fine despite the fact that the rest of the app, including the login, is still on the old system. You know you’ve done a solid job of engineering your software when things like that happen.
Also the weird hanging bug vanished. I think it occurred because the core Flex libraries were being linked to (as Run-time Shared Libraries) instead of being compiled into the SWF as they are under the Flex 3 SDK.
Major outstanding issues, which will hopefully receive some attention tomorrow:
- I tried to do the namespace conversion but it looks like this is going to be a bit more involved than a simple copy-paste. In fact, I think I’m inclined to stick with the Flex 3 namespace until the final version of Flex 4 is released because the namespace/Spark/Halo issue has caused the Flex 4 SDK to radically change at least twice. Right now it looks like you need a mix across three namespaces to make things work: the MXML 2009 namespace only contains language-related stuff (as opposed to MXML 2006 which has everything and the kitchen sink), while the “existing” UI components are in the Halo namespace and the “new” UI components are in the Spark namespace. Naturally, not every Halo component has a corresponding Spark component. So I really don’t want to port everything just to find out that Adobe is so fickle that they changed their minds again for the final version. On a side note, you really don’t understand the definition of “beta”, do you, Adobe? “Beta” means (or is supposed to mean, at least) that the product is mostly feature-complete and no more massive changes are being made.
- The development build process is kludgy right now; I’d like to go back to a pure Ant build, but for now we at least have something that works. The test build, I’m sure, is utterly broken right now.
- Most of the existing code is still using the old auto-generated service code, as mentioned previously. These need to be updated to use the new auto-generated service. As I said, nothing is currently broken in regards to the web service, but having two sets of service code is unnecessary bloat.
- The new Package Explorer makes it much easier to see how the code should be organized. I’ve already performed some minor refactorings to move things around, but there are a few more that should probably happen.
On a related note, I’ve got some crap due for Webware on Thursday. Heineman basically gave us an assignment that says “learn Perl and make massive changes to this thing I wrote 13 years ago and haven’t touched since”. I’ll probably be messing with that most of the day tomorrow. Good thing Pollice is back on Friday and we (hopefully) won’t have any more assignments with such insane deadlines.
Pingback: Flex Sucks: Greatest Hits! « CaptainRichard's Blog