Flex 2 :: The future :: Components
Hello,
In the days of Flash and HTML/PHP I thought to myself as I used php, how can I stop duplicating these things I do everyday?
The answer;
Classes and Components.
Components for me is more of an art for than anything else. You may have seen on blogs before, even this word press home page says “Code is Poetry”. Sometimes you don’t know how true this statement actually is until you write a component that saves you time and money.
Poetry;
What is it? Is it just some artist wasting away in the depths of there own depression or a super idealistic human that cannot face reality’s cold winds? Maybe the both but I have another take on it(My first love is my family, second is music and art and third is programming). Somehow I have found a way to find an artist’s expression through writing Flex 2 components. This may sound funny, odd or even makes sense to some.
Here is an example;
Ely Greenfield of Adobe, that ‘charting guy’ has inspired me more than once to go beyond my imagination and reach into that untapped fountain of innovation all humans have. Here is the point, when something inspires you to find a greater truth about something you do or feel it is poetry. So what do components have to do with poetry Mike!
Ok, here goes, when you create modular things such as components you create something that has it’s own boundaries. Something that has defined itself unto itself and does not need anything else to explain other that it’s origonal context. With lyrical poetry, this is the language you speak or write it in, for components this happens to be the AS3 programming language that applies itself to making parts of a Flex 2 application easier to maintain and replace.
When a component developer sets out to make a new component, usually it comes from some inspirational thing they have seen elsewhere in the context of AS3, UI design patterns or just waking up from a dream and saying wow that is a good idea.
Another trick to creating good components is finding out what clients use. When Adobe set out to make this version of the Flex 2 component set, they realized they needed to create more components that followed a ‘template’ approach. This approach allows clients using these components to inject their own application’s need without overriding or doing the infamous ‘copy and paste from class’ routine.
Mike’s 4 sectors of components
Like the yin and yang we all hold a part of eachother inside of ourselves.
This brings me to another point. There are different kinds of components. We have widget components, template components, facade components and application components. I am sure there are others out there but my mind boils the equation down to these simple areas.
Widget Components
The widget is anything that is a control or something that inherently needs to hardcode it’s behavior into the class because it defines a ‘task’. The Button, ComboBox, TextInput are all good example of widget components. Being a widget component doesn’t mean that it is not extendable, being a component means that it can be extended and had extension in mind when it was created.
Template Components
The template components consist of anything that has an abstract usage such as the Box, Tile, a List could even fit into this category now that Adobe has introduced itemRenderers. The List’s layout algorithm is the template for the component and the item renderer is the widget of the template. Widget components always find themselves inside some template component.
Facade Components
The Facade components are also great and find themselves in the realm of timesavers, algorithm cover-ups and tried and true usage implementers. A facade component always holds those template components that hold the widget components.
A lot of the time you will see facade components outside of a framework OR actually defined an extension of the framework they are derived from. If you created a login panel that connected to any type of backend that encapsulated the get user info, submit and return validate, you now can see a facade component in action.
Facade components are the foundation of why OOP will prevail as a paradigm that ‘just works’. Facades cover up all the lower level functionality that gets reused over and over again.
These types of components are also very valuable to large companies that share code bases and need the same functionality repeated over and over again without bugs and errors.
Here we have the same thing as above, facade components hold template components that hold widget components.
Application Components
The Application components step the internet revolution that I see one more peg to the North. If you encapsulate an Application with hooks, the new SWFLoader can be your greatest friend.
This is a very high level of modularity that you will see being used by talented developers that want to share an application’s public API.
This also could be view like when using an mxml component that implement the
PS I don’t think Apollo is ‘just another browser’ either.
Peace, Mike
June 30th, 2006 at 5:23 pm
Really nice information with great encouragement……..
Pls continue with more info……
Best of luck for your flex-poetry epic
Jignesh Dodiya