Flex Pasta » Top 5 Wishes for Flex Open Source

Top 5 Wishes for Flex Open Source

It has been about a year now since Adobe announced it was open sourcing the Flex SDK, BlazeDS, and the Flex Compiler.  Today on my way home, I started thinking about improvements to the Flex Open Source Adobe that I would like to see in the future.

5.  Upgrade LCDS/BlazeDS to Java 5.

I am not sure the reasoning for having BlazeDS written in Java 1.4.  Most projects using Flex are going to use Java 1.5 since they are most likely newer software.  If for whatever reason, BlazeDS to Java 5 is not viable, at least create a separate Java 5 project that extends the BlazeDS code base.  This project could use features of Java 5 to give developers more tools.  In particular, annotations with remote objects would be a huge advantage for developers.  Bean property configuration, service method security, better enum handling, code generator support, etc would all be great.

4.   Bring the Flex Compiler Source Code out from the shadows

After attending MAX last month, I heard little about improvements to the Flex Compiler for Gumbo.  I guess the compiler isn’t the sexy part of Flex so maybe that is why.  But the compiler is just as important as the Flex SDK itself, so I would love to understand how it works.  I think the community would benefit with more exposure to the compiler code base.

3.  Make it easier to set up the Flex SDK, BlazeDS, and the Flex Compiler for local builds

The most looked at code base of the three components is probably the Flex SDK, just because we can hit F3 in eclipse and go look at the source code.  However, how many people out there(other than Adobe employees) know how to check out the source code for the Flex SDK, BlazeDS, and the Flex Compiler and then be able to make changes to the code?  I have been able to do it for the Flex SDK and BlazeDS, but it took some time(I also don’t think my config was ideal).  I spent a couple of hours trying to figure out the Flex Compiler with no luck.  I am hopefull for a little documentation for those of us out on an island trying to set it up.

2.  Improve the ability to run different versions of the Flex SDK

If you go out and download Flex Eclipse plug-in site today, you will probably get Flex version 3.2.  The rest of the development team might be using another version; say version 3.0 on the project.  Figuring it might be a good idea to have the same version of Flex as your coworkers, you visit opensource.adobe.com to download version 3.0.  The nice interface in FlexBuilder lets you have multiple Flex SDK’s installed and you can easily flip the compiler between different versions of the SDK.  One problem: Charts.  When you download the plugin, you get the charts bundled with the source code, but when you download releases from the open source page, charts are left off(I’m not sure the reason).  This means a project using charts won’t compile for you without some hacking to get it to work.

1.  Avoid using mx_internal/private in the Flex SDK

There are important instances where the private keyword is usefull(when I don’t want a subclass to override it or even be able to call it).  However, and I admit to doing this as well, we tend to use the private keyword by default when we don’t want a method to be public.  The protected keyword would be a much better option for the majority of methods in the Flex SDK.  I have found it difficult at times to extend Flex components and even BlazeDS code because the methods are private or mx_internal.   Maybe it was the intent of the authors to keep these methods private to avoid future upgrade hassles, but it can be problamtic to extend them.  My latest example of one such problem involves creating a ColumnChart.  I created the chart and had a ColumnSeries.  The chart was simple and I set the properties  labelAlign=”center” labelPosition=”outside”.  I was wanting to center the labels at the top of the bars on the outside.

Chart

As you can see in the picture, the labels are left aligned.  The as-doc states that labels on the outside can only be left aligned.  I want to try and extend column series to get the labels in the middle.  I find the method:

private function renderExternalLabels

I can’t extend it since it’s private.  Ok, so I find where renderExternalLabels method is called.

mx_internal function updateLabels()

This goes on for four or five methods before there is one that can be extended.  The point is that marking methods protected more aggressively can help everyone out who is trying to extend these components.

Those are my top five wishes for Flex Open Source.  What are your wishes?

8 Comments

  • 1. Adrian Parker replies at 12th December 2008, 9:15 am :

    Hi - re point 5. Blaze DS is at Java 5 is it not? The BDS releae notes say 1.5 is the minimum see Blaze DS release notes. LiveCycle is still at 1.4, however.

    Personally I agree to move to 1.5 is overdue, but the Flex project I am currently leading at a top 5 bank needs 1.4. Our servers are still at 1.4 and until they move, moving DS to 1.5 would make us tear out DS, and possibly Flex with it.

    I suspect this is why DS is left at 1.4 - Adobe dont want to lose the really big companies who still work at Java 1.4.

  • 2. Joeflash replies at 12th December 2008, 9:52 am :

    The mx_internal namespace is actually much preferable to the private access modifier. private class members cannot be accessed at all without modifying the source code, and monkeypatching the Flex framework means I can’t use persistent framework caching RSLs and compatibility is a pain because I would basically be using a custom Flex framework.

    The mx_internal namespace is intended to be a internal or pseudo-private accessor, only it can be used if you reference the namespace. Simply type

    import mx.core.mx_internal;
    use namespace mx_internal;

    …in the class where you need to reference code which uses this namespace, like so:

    stepper.mx_internal::inputField.restrict = “0-9″;

    …where inputField is an mx_internal property of the NumericStepper class.

    Daniel R. has a good intro post on this here: http://life.neophi.com/danielr/2007/05/mx_internal.html

    So you see, mx_internal is there so that we can use internal class members if we wish, and not have to hack into the framework. So this a good feature which should not be removed from the SDK.

  • 3. Jethro replies at 12th December 2008, 10:03 am :

    Your last point is spot on.
    We are frequently being hit by this and I have no idea why they make soo much private. Its like they have never heard the word “protected”!

  • 4. Damon Cooper replies at 12th December 2008, 1:29 pm :

    WRT “Upgrade LCDS/BlazeDS to Java 5″: next release of LCDS and BlazeDS we will definitely be on 1.5. Duly noted on the requests to use some 1.5 features.

    Damon

  • 5. Brian Telintelo replies at 12th December 2008, 8:05 pm :

    Adrian - Interesting find on BlazeDS on 1.5. It wasn’t like that for release 3.1, but seems to have gone to 1.5 in 3.2. We don’t want the banks to stop using Flex though!!!

    Joe - Thanks for the insight into mx_internal.

  • 6. Nate Beck replies at 15th December 2008, 1:33 am :

    You know… I’ve found myself asking the same question. Why on earth did they mark that function private? My best guess is that some parts of the code were originally part of Flash 8 and were ported from AS2…. but that still doesn’t explain all of the places where I’ve run into that.

    Great post!

  • 7. Polaco replies at 6th December 2009, 11:26 am :

    Totally agree about the private access problem. I have hit that wall 100 times. Protected would be of great help. For instance the NumericStepper component has a method called “checkValidValue” that rounds the user input and rounds it to a step value. Some cases that is not desired however since the method is private you can not overwrite it. Protected would have been the way to go.

  • 8. Bob replies at 3rd June 2010, 11:10 pm :

    Hi, this is a great article, thanks for that.
    I have a similar problem with ColumnChart. As you know Flex ignores the labelAlign=”center” when you set labelPosition=”outside” but I need to get them to work together. it means i need to have my label outside and center aligned.
    I tried to follow your instruction for ColumnChart but i couldn’t find the rite spot to make necessary modification. I am totally lost in mx_internal for ColumnChart. you mentioned on your blog that we can use updateLabels function in mx_internal but i have no idea how to do that.

    Could any one help me on this I would really appreciate.

    Thanks in advance.

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <blockquote cite=""> <code> <em> <strong>