pattern

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