I'm pleased to announce that the Prana Framework 0.6 release is now available.

Download | API Documentation | Changelog
In this release the following remarkable changes and additions have been made:
- the IoC container is now ActionScript 3 compatible
- command factories for Cairngorm's FrontController
- more PureMVC experimenting
ActionScript 3 compatibility
We got lots of reactions from people who wanted to use Prana in ActionScript projects but couldn't because Prana relied heavily on some Flex framework specific classes. Well, we have now resolved this issue by completely refactoring the IoC container and parser so that all Flex dependencies are removed. As a result we now have 2 different application context implementations. The first one is the standard XMLApplicationContext which is aimed to be ActionScript 3 compatible. The second one is the FlexXMLApplicationContext which actually extends the XMLApplicationContext and adds support for Flex specific classes like ArrayCollection. The application context and the XML parsers are now configurable with XML node parsers and reference resolvers so it would theoretically be possible now to extend the XML dialect with your own tags and have them parsed by the application context.
Command Factories for Cairngorm's FrontController
In order to reach maximum flexibility in setting up commands and business delegates, we have introduced the option to create custom command factories that plug into Cairngorm's FrontController. The FrontController actually allready acts as a command factory since it takes an event name, looks up its corresponding command and instantiates that command. We have abstracted that behavior so that it is now possible to write a custom implementation of a command factory and register it with the FrontController. This is very handy when you want commands to handle different implementations of business delegates without the need to instantiate a business delegate directly in a command, making it hard to test and change.
What follows is an example of a command that is configured with a business delegate at runtime via the IoC container.
-
public class AuthenticateUserCommand extends AbstractResponderCommand {
-
override public function execute(event:CairngormEvent):void {
-
super.execute(event);
-
var e:AuthenticateUserEvent = event as AuthenticateUserEvent;
-
IUserDelegate(businessDelegate).authenticate(e.username, e.password);
-
}
-
}
-
<object id="frontController" class=“org.pranaframework.cairngorm.control.CairngormFrontController">
-
<method-invocation name="addCommandFactory">
-
<arg>
-
<object id="userDelegateFactory" class="org.pranaframework.cairngorm.business.BusinessDelegateFactory">
-
<property name="delegateClass" value="com.domain.business.UserRemoteObjectDelegate" type="Class" />
-
<property name="service" ref="userService"></property>
-
</object>
-
</arg>
-
<arg>
-
<array>
-
<value type="Class">com.domain.commands.AuthenticateUserCommand</value>
-
<value type="Class">com.domain.commands.AuthenticateSSOUserCommand</value>
-
</array>
-
</arg>
-
</method-invocation>
-
</object>
Notice that we are registering the command factory with the FrontController via the "method-invocation" element. This is a new XML element that was introduced this release and that is actually preprocessed to a MethodInvokingFactoryObject.
Further, we are configuring the FrontController with a BusinessDelegateFactory which is available in the Prana Cairngorm extensions. We need to specify a name of the business delegate class we want the factory to create and also pass in a reference to the appropriate service. We also need to make clear to the FrontController what commands need to be created via this factory. As you can see we added 2 types of commands, a AuthenticateUserCommand and a AuthenticateSSOUserCommand.
When the FrontController receives an event, it will look up the corresponding command (just like it works in Cairngorm), but instead of creating a command via its class name on the fly, the controller will lookup the command factory it needs to use and then use that factory to create the command. In the example, a command will be created and a business delegate will be injected.
More PureMVC Experimenting
The Prana-PureMVC team has been playing around with some new ideas around better integration between the two frameworks. Some of the key changes and improvements are:
- changes in internal implementation which are not so much visible from the end user standpoint, but can potentially have some impact on wider prana/puremvc acceptance
- new feature which enables significant reduction of name constants during registration, retrieval and removal of puremvc elements (proxies, mediators and commands)
- new feature which enables additional and different startup idiom with which prana can be initialized late instead of up front as it had to be before
For a full and in depth discussion on these changes, please see the text file at "prana-sample-anotherArch101Demo/resources/docs/pranaPureMvcIntegration-FurtherDevelopment.txt".
Conclusion
We hope you enjoy this release and we are always interested to hear from you. So if you have any comments or suggestions, be sure to join our forum at http://prana.herrodius.com.
Hope you enjoy this release and have fun coding.
Add to Bloglines - Digg This! - del.icio.us - Stumble It! - Twit This! - Technorati links - Share on Facebook - Feedburner
Christophe Herreman is a software developer living in Belgium. He's working on high-end Flex and AIR solutions at
July 14th, 2008 at 7:11 pm
Igenko has been migrated to Prana Framework 0.6. Thanks a lot for PureMVC integration improvements.
July 23rd, 2008 at 11:15 am
Just by accident found that prana 0.6 was released as I read your personal site. Shouldn’t http://www.pranaframework.org/ be updated?
Cheers,
Marcel
July 23rd, 2008 at 11:28 am
Hi Marcel, you are correct. I somehow forgot to update the site. I posted the announcement but still need to install some plugins to show the code samples. Thanks
July 31st, 2008 at 12:12 pm
Is there documentation on getting started?
July 31st, 2008 at 12:31 pm
Nevermind I found the PranaFramework.org
August 27th, 2008 at 7:22 pm
Hey, Christophe. Can you explain why extended framework support for Cairngorm/PureMVC etc is in the top level packaging? Took me a bit off guard when viewing the source tree. I would have expected stuff like that to be in say org.pranaframework.compatibility or something similar.
August 28th, 2008 at 1:39 pm
Hi Christophe,
Prana is absolutely awesome, I’ve just started using it in a project and so far its brought me loads of joy
One thing I don’t understand about this addCommandFactory invokation though, you invoke addCommandFactory method with two arguments (if i understand the config correctly). The first is an implementation of IBusinessDelegateFactory and the second an array of classes. Yet if I look at the method signature in the source for the CairngormFrontController it looks like this:
addCommandFactory(factory:ICommandFactory)
So, am I missing something blatantly obvious here, or does your example contain errors? (And yes, I’m looking in the source code of Prana 0.6 :^) )
cheers,
Roland
September 22nd, 2008 at 3:52 pm
Hello Christophe,
i have a general question on Prana: Loading an applicationContext.xml file means
that you need to compile your app with ‘use-network=false’.
What if you configure an object with a remote URL (like
)
and you need to load that xml file at runtime?
I guess this behaviour has to be solved for many applications, when using
a framework like Prana. So is there an elegant way to load an applicationContext.xml file and still be able to access/load remote URL’s
without running into sandbox and local-with-filesystem problems ?
Thanks for your thoughts.
Best regards
valley
September 22nd, 2008 at 3:54 pm
Again the example for the remote URL configuration:
September 22nd, 2008 at 3:55 pm
hmmmmmm, doesn’t work. I mean just defining a constructor-arg node with
a value that contains a remote URL of a file that has to be loaded at runtime.
You can delete 9) and 10)
November 14th, 2008 at 1:20 am
With reference to injecting delegates into Cairngorm commands, it also shouldn’t be to difficult to inject the appropriate model objects?