March 28th, 2007

Adobe releases their GC-files…

Garbage Collection and memory management have been on the mind for those of us who have been developing Flex applications, namely ones that require long periods of operation or large and numerous file support.

As we try to debug our applications and find more information on GC we’ve realized that there are no tools and hardly any information on the topic…that is until now.

During past projects I had email correspondence with Kyle Quevillon a Senior Support Engineer for the Flex product line at Adobe. During our troubleshooting process he shed some light on some of the internal garbage collection and memory management specifics regarding the Flash Player and Flex development. At the time he even provided some memory test utility code which was very helpful in diagnosing the issues. The good news, the dialog I had with him was a very common occurrence with Adobe support and their Flex customers, and thankfully the dialog and memory test code has been posted to his blog, thanks Kyle!

Back on March 16th, I attended Apollo Camp. I had been working with the alpha release candidates and had a pretty good feel for what Apollo has to offer. Luckily for me, this meant that I could take full advantage of the “Ask the Experts” room they had in the back corner fully populated with all the Flex and Apollo bad asses on the Adobe starting lineup.

With my access to “Ask the Experts” I just couldn’t wait to hop into the room and talk about GC, memory management, and best practices. This resulted in a very in-depth and enlightening conversation on the topic with Alex Harui a very knowledgeable Adobe Engineer…sorry Alex, I don’t have your official title.

Well, after 11:30pm hit, the Adobe office where they were holding the Apollo Camp turned into a pumpkin, and I was ushered back into the real world…since the camp it had been my intention to blog about what I had discussed with Alex, I had an extensive set of notes written and ready to be massaged and published sitting on my pda phone.

The good news was that during my discussion with Alex, he had mentioned that he needed to consolidate his thoughts onto a blog somewhere…thanks Alex! Alex’s post has a link to a very good presentation he had done on Flash Player GC, and looking at the notes on my pda phone most all of them were covered in the presentation.

So, the Flex community should thank both Kyle and Alex for releasing this information, not to mention the example code and Powerpoint presentation you can download from their blog posts. I certainly am grateful.

In closing, double checking my notes with theirs, I did see a couple of interesting omissions, that I figured I’d bring up here:

  1. If you have a variable that references the innards of an object and not the object itself, that will not count as a reference to the object. For instance, if you have an ArrayCollection of Human objects, you create a variable of type Human and reference one of the Human objects within the ArrayCollection this will not count as a reference to the ArrayCollection.
  2. Alex had mentioned that there were two known GC related memory leak bugs caused by the Flex Framework:
    • If you use PopUps that have ComboBoxes in them, when the PopUp is removed and garbage collected, the ComboBox will remain since the PopUpManager is still holding a reference to the ComboBox
    • When you implement a navigator container such as a TabNavigator or ViewStack and make use of the HistoryManager, the way that references to the HistoryManager and back again are created, causes an issue with the garbage collector when it goes to count references.
  3. For those of you that have entertained the thought of using destructor functions like in C++, don’t bother. Reason being, destructor functions are usually used to free memory, and that’s handled by the Flash Player garbage collector. However, one thought about a destructor that you may want to extrapolate would be to have a cleanup function or even a manager to remove event listeners, references, etc.  That’s something you can read more about at the Skinner blog. (Starting on slide 30 he discusses an IDisposable interface and a Janitor utility class)
  4. Since MAX 2006 we’ve all been waiting for the Flex Profiler to help us debug our memory management issues. I’m sure that at times that we’ve also felt that Adobe was being mean, and holding out on us…I’ve seen plenty of cries within the newsgroups and blogosphere to just release it. Well, I can tell you now that according to Alex, the reason for the hold up is that the profiler UI uses some new functionality in the Flash debug player that won’t be released until Moxie is released. In other words, they could release the Profiler now, it just wouldn’t do anything useful.

Anyway, I’ll be excited for Moxie and the new Flex Profiler, it should make memory management troubleshooting much less painful. In the meantime, it was good to see these recent posts from the Adobe folk!

March 23rd, 2007

Review: Adobe Flex 2 Training from the Source

If you are planning on taking the Flex certification, wanting to fill some gaps in your knowledge of Flex, or want to find a cheap alternative or supplement to taking the Certified Instructor-led training, Adobe Flex 2 Training from the Source will deliver. (Btw, clicking on that link will take you to sample chapter excerpts.)

The book content is well organized and consists of a just-in-time learning methodology. You start a chapter and receive a summary of what you will be working on. After that the rest of the chapter is hands-on while offering tidbits of information on new concepts and material as they first make their way into the development during the labs.

As an Adobe Certified Instructor in Flex, reading through this book reminded me of the course materials in the Adobe authorized curriculum, following a similar flow and teaching style. One thing I liked about this book is that even if you had taken the standard authorized training courses – Flex 2: Developing Rich Client Applications and Flex 2: Data and Communications – this book offers material that’s not covered in either of those classes. The bonus is that this additional material is presented in easily digestible chunks with good hands-on labs for reinforcement. Some examples of the value-added material are:

  • Lesson 12 – Using Drag and Drop
  • Lesson 15 – Using the History Manager
  • Lesson 23 – Printing From Flex
  • Lesson 24 – Using Shared Objects

Another nice thing about the content in the book is the Tips, Notes, and Cautions scattered about. Tips offer alternate ways to accomplish the task at hand. Notes, add some additional background information not necessary for accomplishing the task but good to know. The Cautions do a good job of letting you know of spots in the labs that may cause you to pull hairs out if you’re not paying attention.

The authors are skilled in discussing advanced concepts accessible to new Flex developers seemingly without even breaking a sweat. One example was during Lesson 10 Creating Custom Components with ActionScript 3.0 – method overriding, chrome, rawChildren, and updateDisplayList().

As far as the labs were concerned, through much of the book you are working through a “Flexgrocer” suite of applications. To me working on an app from start to finish, using each of the new concepts as you go along is a very powerful way to learn the material while realizing the WIIFM’s.

In regard to the print format, all too often I’ll see a tech book with interesting material that’s in a small font and jumbled together without sufficient whitespace…headache and instant turn-off. I thought that this book made good use of typefaces, whitespace and I appreciated the size of the font throughout.

After all this praise, I’m sure you’re wondering if there was anything I didn’t like about the book…there were two things:

1. The lab files were not Flex Projects exported from Flex Builder, instead they were zipfiles with just the source. In other words, it would have been nice if the lab files were an archive file containing a “Training from the Source” Flex Builder workspace with the corresponding lesson projects.

2. Within the chapters themselves, the lab files were not broken into chunks, in other words you couldn’t skip the first lab in a Lesson and start working on the second or third lab in a lesson without running into something being missing or potentially broken. In other words, this book was designed to have someone work a Lesson from start to finish.

Now that I’ve left the negative taste in your mouth, let me remove it by saying, this book is definitely a worthwhile addition to your Flex library.

It is a good supplement to the authorized training, and is excellent study material for the Flex 2 Developer exam. Just to give you an idea, if you look at the topic and objectives in the exam guide, the only thing this book doesn’t really seem to cover is UML or Use Cases…but to be fair I wouldn’t expect it to…

All in all, bravo to Tapper, Boles, Talbot, Elmore, and Labriola. Thanks for the excellent read!

March 23rd, 2007

Review: Adobe Flex 2 Developer Exam

Well…I took the plunge and got certified in Flex. Now that I have, it’s time to give my opinion.

Before proceeding any further, I’ d like to say , if you’ve just read Flex books and haven’t done a lick of code…don’t even bother with this exam.

Also, if you’ve written a lot of code and haven’t spent too much time in the help docs or any Flex books, I would say that it would definitely not hurt to at least do some skimming. You’ll know when you’re successful with skimming when you notice yourself saying, “oh yeah forgot about that one” or “wow, I’ve never seen or used that before”

I’ve taken plenty of vendor certs before (MCSE 4.0, CFMX 7, etc.) and would have to say that my impression of the exam is that it was well rounded, not too inaccessible, and had a good question/time ratio. In other words, I got through the questions without feeling rushed and while I was reviewing the ones I had marked for review, the session timed out. Best word of advice is not to dilly-dally on the questions you’re not sure on.

As far as the content in the exam, all I have to say is that it was well rounded. In the test you’re dealing with UML, J2EE, FDS, Charting, AS3, MXML, OOP, Software Architecture, and anything else Flex you can think of. (Reference Topic areas and objectives in the Prep Guide) The Flex product line is huge, the Framework is gi-normous, and having to worry about software architecture, OOP, and actual AS3 coding practices All I have to say is bravo to Adobe on the breadth of the question pool.

So…if I haven’t scared you from taking the test, here are my recommendations:

1. No joke, make sure you are comfortable with every bullet in the exam prep guide

2. Write some apps, c’mon people. ;-)

3. Take some training

4. If training is not an opportunity for you, then definitely check out Adobe Press book Adobe Flex 2 Training from the Source I COMPLETELY agree on this one with both Daniel and Angus good job guys, thanks for the tip!

5. Actually, skimming through the Training from the Source book and taking a note of the tips, section heading blurbs, and code examples is a good refresher even if you had a chance to train. (Btw, the link in #4 above will take you to four downloadable chapter excerpts)

6. Grab a copy of the detailed exam specs. Everyone referred to it in their blog, but I could not find a downloadable version of the pdf…however, being the cool search engine that Google is, I did get a hold of a cached HTML copy…

[JCH: Updated 3/19/08 START] http://office.realeyesmedia.com/blogs/jun/samples/certification/Flex20Blueprint.htm 

[JCH: Updated 3/19/08 END]

7. Go for it!

Anyway, hope this is helpful to someone…let’s get Flexified ya’ll!

March 21st, 2007

BadFlexBad Entry for Wed., March 2007

Alright, here's one for the "what were they thinking?" category...when creating dates, the Date() constructor takes in a zero indexed month but not a zero indexed day, huh?

XML:
  1. </code>
  2.  
  3. <mx:application xmlns:mx="http://www.adobe.com/2006/mxml">
  4. creationComplete="ccInit()"
  5. layout="vertical"&gt;
  6. <mx:script>
  7. <!--[CDATA[
  8. private var dateIChose:Date;
  9. private function ccInit():void
  10. {
  11. // When passing in the month parameter, keep in mind it's zero indexed...
  12. dateIChose = new Date(2007,3,3);
  13. }
  14. private function populateDateField(p_evt:MouseEvent):void
  15. {
  16. // Check out the DateField being set to April...
  17. my_df.selectedDate = dateIChose;
  18. }
  19. ]]-->
  20. </mx:script></mx:application>
  21.  
  22. <mx:datefield id="my_df"></mx:datefield>
  23.  
  24. <mx:text id="description_txt">
  25. width="200"&gt;
  26. <mx:text>
  27. Click on the button to
  28. populate the DateField with
  29. 2007 for the year,
  30. 3 for the month,
  31. and 3 for the day.
  32. You think it'll set to March right?
  33. </mx:text>
  34. </mx:text>
  35.  
  36. <mx:button id="setDate_btn">
  37. label="populate DateField"
  38. click="populateDateField(event)"/&gt;
  39. </mx:button>

Click here to run the code

March 21st, 2007

Wondering about Apollo Server Dialog?

Apollo alpha is out now yay!

One of the first things I did when downloading the alpha and supporting materials was to create an Apollo project and look at the new project properties available in Flex Builder. Low and behold:

Flex Properties - Apollo Server dialog

Interesting...first thing that came to mind was a centrally managed auto-update feature. What could it be?

Well, during my stay at ApolloCamp there was an ask the experts booth. Being the inquisitive person I am I decided to bring up the dialog.

The answer from Adobe was Oh yeah...we were gonna do something with that but then decided not to. Sorry to get your hopes up, but that's a UI bug, doesn't do anything and shouldn't be there.

Anyway...

March 1st, 2007

Yahoo services vs. Flex/Flash

[EDIT: I've updated the link to the request for del.icio.us. crossdomain.xml.  Reason being, it had gotten merged into a different suggestion and never implemented]http://suggestions.yahoo.com/detail/?prop=ydn&fid=83770 [EDIT]

Hey everyone,

Here's a couple of suggestions to vote for on the Yahoo Developer Network:

[EDITED: The three links below are now defunct]

Crossdomain.xml for Yahoo services

FLEX 2 API for Yahoo! Maps

Flex 2 API: Bring it On!

Voting for them will make your live as a RIA developer much easier...or at least we hope...so please click the links and vote for ease-of-RIA!! Woo-hoo!

Upcoming Talks





A Book I Helped Write



Community


Ignite Denver Committee

Categories

Credits