Flex

  • Feb 18 2009 - decision making : flip a coin then check your gut ...

    I once heard an interesting anecdote about how to make a difficult decision between two paths. When you find yourself spinning, alternating between one choice and then the other, it can be helpful to simply assign each choice “heads” or “tails” and flip a coin. When you reveal what side the coin landed on pay attention to your emotional reaction… are you relieved or are you disappointed?  Try it sometime, it really can work.

    I recently spent about three weeks or so doing an in-depth analysis of Adobe Flex vs Microsoft Silverlight for an enterprise application and I really feel like I ultimately decided via the coin flip method (without actually flipping the coin). Our company is about to embark on a new product aimed at the enterprise that will require levels of functionality and control that Ajax alone can not provide. We are essentially looking to take a workflow that has been heavily dominated by Word and Outlook and drag it into the future with real-time collaborative tools in the spirit of Google Docs.

    I ended up choosing Silverlight, despite the potential risk adoption may pose. At the end of the day we believe our target market will be willing to accept the Silverlight install process, and that the underlying engine (.net) provides far more robustness for building the kind of application we’re looking to build. Honestly this is a whole other post, but the nail in the coffin for Flex ended up being the lack of threading support for developers. On nearly every other level the two were neck and neck, with very subjective “wins” for either and Flash being the clear winner when it comes to adoption etc.

    What’s interesting though is that my first choice was Flex. After weeks of agonizing I decided we needed to build this thing in Flex, working around the lack of threading where necessary and going with the safe route of next to zero adoption barriers. It only took a weekend after making that decision to flip-flop. I was supposed to be making the call as if this were my company on the line, and with a clear vision of the unknowable future… at the end of the day though taking the safe and compromised route just didn’t feel right. I could see the complexity of our application snowballing in the future, I could see the legacy of the flash runtime catching up with us, I could see a competitor choosing to build their offering in Silverlight and spanking us in the next year. Making the decision from a technical standpoint the only winner was Silverlight, if the business deemed the adoption risk too great then fine we could do Flex, I was prepared for either.

    My proverbial flip of the coin had basically taken those three weeks of opinions and research and testimonials and flame wars had all gelled together once I had made an actual commitment to choosing Flex. It was only then that my gut told me what I needed to know and I have not looked back from Silverlight since.


  • Feb 12 2009 - Flex data services limitations (FlexBuilder generated wsdl code sucks) ...

    The post saved me a ton of time. It’s a bit embarrassing for Adobe in my mind to ship something this buggy. I was seriously running into these issues within an hour of trying to connect Flex to our .NET Soap based services.

    “MyMethod can’t return an object of with the type name MyMethodResult."
    You’re fracking kidding me right?  Wow. (and there are more along these lines)

    http://lukesh.wordpress.com/2008/11/24/very-important-limitations-of-flex-data-services/

    After fighting with the above and other bugs I was rewriting a lot of the generated code from FlexBuilder and it was just pointless. And sure, generated code isn’t the greatest to rely on anyway, but give me a break. In the end I used the WebORB presentation server to handle the communication to our .NET code, as well as for generation of the initial proxy classes for the client and I have to say it was an excellent experience compared to the crap built into FlexBuilder.

  • Jan 31 2009 - QWERTY Myth and the entrenchment of Flash ...

    This is a great article about the myth of how the best technology doesn’t necessarily win. Granted, sometimes the best technology does not win, but there is a persistent and pervasive sense that the populous often chooses the “VHS” over the far superior alternative. The article addresses the VHS vs Beta debate directly as well as the victory over Dvorak by QWERTY. To encourage you to read the original I won’t reveal the clever arguments made.

    http://www.reason.com/news/show/29944.html   (Read Me!)

    I’m posting this because there seems to be a real sense of fait accompli when it comes to the Flash vs Silverlight debate. Critical mass has already been acheived, why would content producers or development shops choose to target any other platform than the Flash runtime when users have clearly already made their choice? How could Beta possibly make a resurgence against an already entrenched VHS? It would take an entire round of evolution before DVD would come along and supplant the status quo. There are a couple reasons why this article has relevance for Silverlight, and why the VHS / Beta argument doesn’t hold water.

    1. Flash vs Silverlight is about a producer investment in technology NOT a consumer investment. Machines are powerful enough, and installations simple enough that the relative cost of owning both technologies is nothing like owning two peices of hardware. 
      1. If there is a competitive advantage for a producer to be gained via a specific technology they will use it. Any differentiators in a competitive field like software has a high potential of making a return. This is a very different decision process than it is for consumers. 
      2. Consumers don’t really care or even know which technology is driving their rich content. They care that it “just works” (like flash based video in comparison to WMP or Quicktime) and that the functionality they desire is there. Without a right-click most users won’t even realize which is which behind the curtain once they have both installed. 
      3. “Owning” everyone (high adoption) is really not that big a deal when your competition can also have 100% adoption at the same time. This is not like choosing a computer or an operating system. Only Microsoft can prevent themselves from achieving their penetration goals.
    2. Better technology does win. I’m not saying that Silverlight is necessarily the better technology right now, Flash maintains an edge on some specific rendering speeds it appears, and their designer tools are clearly better… but Silverlight has the benefit of coming at this with second mover advantage. They didn’t start from scratch, they built out a proven technology (.NET) into new ground by largely copying and improving on the entrenched technology. (sure looks copied from my perspective but that’s a different post) The .NET runtime, threading, compiled/managed code and the lack of legacy in Silverlight will all combine to produce demonstrations of browser based technology that will be extremely difficult and expensive to reproduce on the Flash runtime. 
    3. Silverlight does not have to “kill” Flash to win, it only needs to join Flash in the 90% adoption numbers to be a great success.
    I like both technologies by the way, I’m just entertained by some of the almost religious like statements on those on the Flash side that sound a lot like any attempt to improve or even add to the status quo is a total waste of time. (or somehow an affront to their own efforts)

  • Dec 21 2008 - FlexBuilder 3 First Impressions ...

    Where we’re coming from


    So at the beginning of the year I was tasked with evaluating a number of technologies for RIA development for the next evolution of my company’s product. Up to this point we had been relying extensively on ASP.NET forms with a traditional post-back model that was responsible for a lot of wasted time and bandwidth. We’ve leveraged a lot of Ajax in the past few years, starting with simple fixes like trees and list based controls that use load on demand and going all the way up to full fledged single page applications that consumed purely services.

    This has worked, but the cost is overwhelming for a development team of our size and makeup. We hire smart generalists for the most part, favoring developers with C++/Java/C# backgrounds. Some of our developers have acquired some deeper skills on the client side, but where possible we attempt to leverage control vendors like Telerik  and ComponentArt  as much as possible. They do an excellent job of hiding some of the complexity involved in cross browser web interfaces, but you will inevitably have to “hit the metal” and get your hands dirty. Relying on third parties also removes a lot of the control needed to do things the way you need them done. Regardless despite being a huge fan of the http://docs.google.com suite of tools, I have witnessed far too much ugliness in our organization with supporting multiple browsers (including having to support IE 6) and pushing the limits of complicated UI in the browser. As the size of the DOM increases and the size of our data sets increase we see wild variance in client performance with respect to things like drag and drop. I know it can be done, I know we are not at the limit yet, but seriously this is not pragmatic for our software and our market and our developers. I am a big fan of the view that JavaScript is becomming the assembly of the web, those who do this shit well, do it well by lifting themselves out of the muck with good abstractions like GWT.

    One thing I think should add here in defense of Ajax though; UI design plays a really important role in the effectiveness of the DHTML approach and honestly I believe part of our problem has been designing a far richer interface than we could afford in the technology we were leveraging at the time. Take a close look at Google’s lack of decoration, images etc. These things certainly matter.

    Next steps… evaluation

    Anyway, I’m getting off topic as usual. In the beginning of 2008 my feature matrix analysis really narrowed our options from about a dozen technologies (including XUL, ActiveX, Applets, JavaFX, Silverlight, ClickOnce, Ajax, Flex) down to three. Silverlight, Flex or Ajax. At the time of my evaluation Flex was at version 2, JavaFX was vapourware and Silverlight2 was in Beta. Given that we are a .NET shop and already have the C# programmers, the Silverlight option was looking like it was going to cleanly win out over Flex. Ajax was honestly only at the table still because we needed to justify our position and show we clearly evaluated all our options. Flex was seen as less desirable due to being based on ECMAScript and having to retool and retrain.

    For the most part we’ve seen this as two relatively equivalent technologies with different stories for the developers. While there are important differences between how code is delivered and executed in Flex vs Silverlight, but at a high level we believe technically we can deliver our application in either technology very effectively. We prefer to keep working in C#, but the limited penetration of Silverlight is a serious risk for an application delivered in a SaaS model. That single fact has transformed the whole exercise into largely a business decision.  I don’t doubt Microsoft will be able to push their offering significantly, but I would not bet money on where they will be in 1 year. (Windows Media Player STILL doesn’t equal flash in penetration)

    Tool support however remains something that is extremely important to developers, and is one of those things Microsoft often trots out in arguing the superiority of their platform. We swallowed that line pretty easily at first, knowing that under the hood all the code written for Flex is just a variation of ECMAScript (JavaScript) is enough to scare us off. How can you acheive the refactorability and tool support provided by current and future versions of Visual Studio with a loosely typed language like ActionScript?

    Trying it out


    This week I downloaded FlexBuilder3 after one of our senior executives setup a call for us with Adobe evangelists to get more details on why to go with Flex. Again the motivation for this coming back to penetration and wanting to ensure we are making the right decision for what will become a million plus dollar iniitiave to re-engineer. I wanted to get some hands on time with the latest version of FlexBuilder (3) that had come out since our initial research.

    I was immediately surprised by the leaps Flex had taken since I last really dived in. I’ll admit there was some bias here though as I am also a huge fan of Eclipse, so the fact that FlexBuilder is built on Eclipse is in my mind a huge win. (not new btw)

    The effort in actually building an application that connected to our existing .NET web services was embarrassingly trivial. FlexBuilder has a simple tool for generating and managing proxy classes to represent your web services. So after literally pasting a url into a wizard I had code for talking to our .NET SOAP based web services. (seemed to only support SOAP 1_0 not 1_2)  I then got started with the Form Designer and had a simple application talking to our backend in under an hour even counting the little things that tripped me up like where to add my event handlers which wasn’t immediately apparent. (too reliant on double clicking controls apparently ;-)   hint : <mx:Script> tags and dom style event callouts)

    The concept of states in Flex and the ease with which I was able to create a number of them in the designer and bind those to a dropdown for switching between them was pretty eye opening. A state in Flex is defined by the differences between your main UI (or just another state) and the state you wish to have/be in. The IDE allows you to visually manage these states and then visually modify each one to represent application states. I don’t have an early sense of whether this actually scales for complex applications, but at first glance it’s very cool. (Think hierarchical state machine)  Couple this with the data binding model and you have some very effective UI management tools at your disposal. Maybe this only looks cool coming from our antiquated asp.net approaches, but this stuff is exciting. (Silverlight/WPF have the same capability, maybe even a little more advanced but with more overhead in my opinion) Having your model drive all changes is so much more manageable,  scalable… and just correct than having explicit assignments in page PreRender methods that set visibility based on the state of that model. Barf.

    The control toolkit out of the box with Flex is also extremely impressive. Check out this post for a list of all the FlexBuilder 3 Controls included out of the box . For now at least this control set will mean being highly more productive in the early stages of development than if we were either having to roll our own or rely on third party vendors. And of course you can roll your own in both Silverlight and Flex and each can be just about anything imaginable.

    So I’m sold, at least sold on the fact that Flex deserves considerably more attention than what we had previously given it. I’ve bought the “Flex 3 Cookbook”, and “Adobe Flex 3 Training From the Source” and I’m intending on spending at least some of this Christmas holiday catching up on just what’s possible with that silly little flash technology.



  • Dec 17 2008 - FlexBuilder 3 Controls ...

    Controls included with FlexBuilder 3 out of the box below… check out some third party components here .

    Notes will be updated as I actually get a chance to put some of these to use.

    FlexBuilder 3 Controls
    Control NameNotes
    AdvancedDataGrid  Professional version only
    + multi column sorting
    + grouping
    + tree view
    + printing support
    – Still no paging support out of the box
    AlertControl  not sure how this gets grouped with these other controls as it is not an explicit control but a static method “show()” which can be used from where ever. 
    Button  check out the FlexLib CanvasButton for a more flexible option
    CheckBox  
    ColorPicker  
    ComboBox  
    DataGrid  See this article for some hints on implementing paging
    DateChooser  
    DateField  
    HSlider  
    HorizontalList  
    Image  
    Label  
    List  very fast and flexible, lots of issues with scrolling but workable
    LinkButton 
    NumericStepper  
    OLAPDataGrid  Professional version only
    PopUpButton  
    PopUpMenuButton  
    ProgressBar  
    RadioButton  
    RadioButtonGroup  
    RepeaterSLOOOW when binding to many objects, look at List based controls instead
    RichTextEditor  Limited html formatting, seems to work ok
    SWFLoader  
    Text  
    TextArea  
    TextInput  
    TileList  see list, very fast control but takes a bit more work for smooth work
    Tree  
    VSlider  
    VideoDisplay  FLV based video player with simple cue and playback control 
    FlexBuilder 3 Chart Controls
    AreaChart  
    BarChart  
    BubbleChart  
    CandleStickChart  
    ColumnChart  
    HLOCChart  
    Legend  
    LineChart  
    PieChart  
    PlotChart  
    FlexBuilder 3 Navigation Controls
    Accordion  Great control, but needed to go custom almost immediately ( see FlexLib for custom header) 
    ButtonBar  
    LinkBar  
    Menu  
    MenuBar  
    TabBar  
    TabNavigator  
    ToggleButtonBar  
    ViewStack  
    FlexBuilder 3 Layout Controls
    ApplicationControlBar  
    Canvas  
    ControlBar  
    Form  
    FormHeading  
    Grid  
    HBox  
    HDividedBox  
    HRule  
    ModuleLoader  not really a layout control? ModuleLoader allows you to load components of the application on demand, lowering initial download size and improving encapsulation
    Panel  
    Scrollbar
    Spacer
    Tile  
    TitleWindow  
    VBox  
    VDividedBox  
    VRule