понеділок, 10 січня 2011 р.

Project is closed.

Due to variety of flex frameworks, this project is closed.

неділя, 18 жовтня 2009 р.

Anthill communication diagram. Two-way communication. Manager in ActionScript class.

I've created a diagram of communication between views and managers in Anthill framework. On this diagram Manager is written as AtionScript class and its event handlers added using special metatag "AnthillEventHandler".



понеділок, 5 жовтня 2009 р.

Anthill framework source code.

You can get source code for this framework from Google SVN http://code.google.com/p/anthill-flex/.
If you have any ideas how to improve the framework please contact me vstyran@gmail.com .

пʼятниця, 2 жовтня 2009 р.

Simple login example using Anthill framework (it is not secure login screen and used only as an example)

I have been working on micro architecture framework for couple of month. The main goal is to create micro architecture that will allow you to write less code using mxml features such us binding, event  metadata and custom meta tag. This framework is event driven like Mate. I called it Anthill because Events in Flex like little ants, they move all time carrying high weight objects between pieces of large program.

Lets look on the architecture of simple test program I've created. The program consists of login screen and datagrid where all users are showed. All business logic is separated in Managers. First of all we need to add controller into Application class and register Managers.
Managers should be extended from Manager class provided in framework. Most of programmers create business logic in action script class not mxml. So I created metatag (AnthillEventHandler) that helps to add event listeners. Below you can see login event handler which is located in LoginManager.
During registration LoginManager in Controller this listener will be added automatically. To tell compilator to use custom metatag you need to set additional compile argument:
-load-config+=flex-config.xml
And add following flex-config.xml file:

To work simpler with events in views I've created two classes Dispatcher and Listener, one for dispatching events and another one for listen them (see part of code from Login view below).

Events should be extended from AnthillEvent class provided in framework.

When user presses login button it creates copy of login event with UserVO and dispatches it. After that this event is handled by login method in LoginManager and if name and password is correct it dispatches NavigationEvent that is handled in Main view class:


Anthill event has property called "bindable". See simple below in Users view. When UsersManager dispatches ListEvent with users collection Listener handles this event and if "bindable" is true then it copies all properties from captured event to event in view (you can see List event with id "usersEvent"). So property "list" (which is array of users) is updated and you can bind grid on it.

Here is test application (please, use view code to get source code).