Journey

Sail in ship of ambition and anchor at harbour of success

Flex — making It easy for u guys

Flex .. have u heard ?? Ask a BTech guy he with all Grudge rembering of all compiler ‘s stuff says yes .. ( Btw if u r also from NITK then u ll def remember how u built a C compiler in 3 hrs com lab )!! Well but the Flex i am refering to here is Adobe Flex .

I was essentially a “C” programmer in college days . I loved “C” and enjoyed to get myself involved in the world of pointers. But ya then I entered Adobe in the “Flex” team , and my aim over here is to make it easy for those guys like me .

Well first of all why Adobe Flex is used ??

Flex is used to build rich internet applications , meaning if u want your web app to look cool !! Then you should definitely look at Adobe Flex . Adobe Flex sdk is “open” sourced . Well if you are thinking whats the big deal , just drag drop things and yup you are done !! Sorry most applications are not so direct . As you build applications and start building custom components you ll understand and appreciate the concepts behind this framework .

I would be covering the following concepts in my blogs with brief description of scenarios you will come across:

1> Events : The Dom(3) event Model :Its not just on skin baby .. Its deep!!

Its not just dragging and dropping a button and adding a eventListener . Here I discuss what happens when you add eventListeners , what happens when you do a dispatchEvent and how it gets propogated etc .

2>Custom Components– How to architect a custom component??

What are the important aspects to consider when you are building a custom component . As an extension I also throw some light on MVC model [ If u havent read Gof (Gang of Four) , kindly read it once]

3>Item Renderers : The what n where abouts

ItemRenders are most commonly encountered in Flex . Here I give a detailed insight of this , how to use and why they exist .

In all my articles now you might follow a pattern .. The What ?The Why ?? The How ?? The When ??

So Let me end this with answering

—————————————————————————————————————————-

What is Flex ??

Well Flex is a framework that provides you to build rich internet applications . If you plan to build an application that has rich user interactions like drag and drop , or U want to show dat in charts , or you need some sophisticated data visualisation tools and much more .. pretty easily then You should be choosing ( atleast trying ) Flex . Basically it is a Object oriented Language . It does not have “multithreading” capability but you can use “events” instead of threads . So understanding how “events” work is very essential .

If you ask me Why Flex?? Coz it enables you to build your own frameworks on top of this !! Say you are a gaming company, you want to build a Gaming framework then Flex is a very good option to consider .

Currently Flex is in beta3 , You can download the realted sdks , Forget all just use FlexBuilder for easy development .

—————————————————————————————————————————- Well When I joined Flex team and I heard about this Tool , I was not at all excited …. coz for me “C’ was the “God” . I looked at the sdk code , I find hazaar classes and hazaar interfaces🙂 I knew the concepts of OOPS but had not involved myself in building a big project . Its now especially after understanding MVC [ observer patterns] I appreciate the interfaces .

Well when u look through the code you ll find interfaces like IDataRenderer [ Here in FLEX anything that begins with an “I” is an interface] . Probably you guys already know . But let me explain why these are required .

Well interfaces are like contracts . Its very important to understand the essence of interfaces since Flex allow hig degree of customisation .

Say we have ComponentA and ComponentB . You have written a default “look ” n behaviours of both the components. ComponentA and ComponentB both interact with each other may be like

1> ComponentB sends some data ( say some Array) to ComponentA

2> Based on this Array ComponentA does something

Now if you want to give the flexibility to someone to create his own ComponentA or ComponentB How would you do??Or to put the question in easier manner , Someone dont want to use your look of Components or he adds entire new set of functionalites to say ComponentA how will you ensure that both components still communicate to each other ??

In the above example anything that is in the place of ComponentA should have a Array . Anything that is in ComponentB ‘s position should have a instance of ComponentA and also a method called send using which it sends an Array to ComponentA .

So we say all components that want to be componentA should implement IComponentA which would look like

public interface IComponentA{

public set RecieveArray(value:Array):void

public get RecieveArray():Array

}

Any component that wants to take the position of ComponentB should implement IComponentB

public interface IComponentB{

public function send(a:Array):void

public function getInstance():Object

}

Thus interfaces play a very important role in Flex !!

No comments yet»

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: