architecture

Dependency injection for item renderer

One of question on Flex Interview could be: "How would you pass some
extra data into the item renderer instance? Or how item renderer can
access application level data?". Here is some obvious renderer for
displaying logged user and his pet in specified color.

<customrenderer>
       <mx:Script>
       <![CDATA[
           [Bindable]           
           private var settingsModel : SettingModel;
 
           [Bindable]
           private var userModel : UserModel;
 
       ]]>
       </mx:Script>

Read more

  5 Apr 2008 - 4:04pm

Dependency injection in flex

Finally I played with inversion of control in flex. It was only one thing that I missed in big actionscript application. Here is sample dependencytest.zip

Start conditions

To implement dependency injection need a way to access to each class in application in order to define if it marked with metadata or not. Metaprogramming way can simplify, automate usage of util. But here is one problem. How to get access to all classes in application. Here could be 3 ways:

Read more

  25 Feb 2008 - 10:40pm

Get list of classes in flex application

This isn’t common goal for developers. And furthermore problem solving isn’t easy. Actionscript code doesn’t give access to available classes at runtime. So only trick I can image is parsing swf file by itself and get class names. Crazy implementation? Yes, it is. :-) But no coding here because flash decompilers written in actionscript already exist.

Swfassist:

Read more

  25 Feb 2008 - 2:08pm