Prana 0.4 Released!

ActionScript, Flex, Prana 5 Comments »

I’m proud to announce that Prana 0.4 has been released.

Some of the key features and updates:

  • major update to the core IoC container
  • support for PureMVC
  • several bugfixes and minor improvements

General info: http://www.pranaframework.org
Download: SourceForge Download Page

Changes in version 0.4 (26.01.2008)
———————————–

General
* introduction of PureMVC support
* added PureMVC sample application
* nightly builds available at http://prana.herrodius.com
* fixed config.xsl to ignore _svn folders

Package org.pranaframework.cairngorm
* fixed early dispatching of events in EventSequence

Package org.pranaframework.collections
* added “remove” method to IMap and Map
* changed “size” and “values” methods to getters
* Map now extends Dictionary instead of Proxy

Package org.pranaframework.config
* AppSettings now extends Proxy instead of Map

Package org.pranaframework.ioc
* added check for valid IList before creating cursor
* added “isLazyInit” and “initMethod” properties to IObjectDefinition and ObjectDefinition
* added support for init method in ObjectContainer
* added “removeObjectFromInternalCache” method
* enhancements to “getObject”
* added post processing capabilities to ObjectContainer

Package org.pranaframework.ioc.factory
* added IObjectContainerAware

Package org.pranaframework.ioc.factory.config
* added ObjectContainerAwarePostProcessor
* added LoggingTargetFactoryObject

Package org.pranaframework.ioc.parser
* added support for lazy init and init method in XmlObjectDefinitionsParser
* fixed “parseProperties” because of Map refactoring, keys were not strings in XmlObjectDefinitionsParser

Package org.pranaframework.puremvc
* initial release

Package org.pranaframework.utils
* added Parse port from the Fit framework
* added HtmlUtils utility methods for working with html
* added “isExplicitInstanceOf” method to ObjectUtils


Add to Bloglines - Digg This! - del.icio.us - Stumble It! - Twit This! - Technorati links - Share on Facebook - Feedburner
 

Flex 3 Localization

ActionScript, Flex, tips 'n tricks 7 Comments »

With Flex 3 comes the ability to do runtime localization. Compared to Flex 2 where you actually had to recompile your application for each locale, you can now have one version of your application that contains different resource bundles.

Today I implemented this in one of the applications we are working on and ran into some issues. Here is how I got it to work in a nutshell. (Note: for a full instruction on implementing localization in Flex 3, I recommend the article Flex 3:Feature Introductions: Runtime Localization by Gordon Smith.)

- create a folder in your project to store your resource bundles (e.g. "locale")
- create a subfolder for each locale you want to implement (e.g. "locale\nl_BE" and "locale\fr_BE")
- in the locale subfolder, create a resources.properties file and save it as UTF-8
- enter the resources in the form of "key=value", like Ant property files
- update the compiler settings: -locale=nl_BE,fr_BE -source-path=locale/{locale}

You now also need to create localized framework resources. To do this, take the following steps:

- open a command line (run as administrator in Vista!)
- go to the "bin" folder in your Flex SDK installation folder
- run the copylocale.exe tool for each locale, this will copy the localized framework files from one locale to another (copylocale en_US nl_BE)
- check FLEX_HOME\frameworks\locale to see if the folder for your new locale has been created
- if you get an error "could not find resource bundle charts", search for a file called charts_rb.swc and copy it to the new locale folder in FLEX_HOME\frameworks\locale

A simple example of asking for a localized string:

Actionscript:
  1. // tell the compiler what resourcebundle to use
  2. <mx:Metadata>
  3.   [ResourceBundle("resources")]
  4. </mx:Metadata>
  5.  
  6. // if you are in a subclass of UIComponent
  7. var myString:String = resourceManager.getString("resources", "myKey");
  8.  
  9. // ...or if you are not in a subclass of UIComponent
  10. var myString:String = ResourceManager.getInstance().getString("resources", "myKey");

You can put these calls in a binding expression and switch your locale at runtime by setting the localeChain property on the resourceManager:

Actionscript:
  1. resourceManager.localeChain = ["nl_BE"];

That's about it. Have fun!


Add to Bloglines - Digg This! - del.icio.us - Stumble It! - Twit This! - Technorati links - Share on Facebook - Feedburner
 

Porting the Spring IoC core to Prana

ActionScript, Flex, Inversion of Control, Prana 2 Comments »

I decided that, for the benefits of Prana, it would be better to port the core of the Spring IoC container as much as possible instead of developing further on an own implementation. Although the XML dialect for the application contexts is already similar to that of Spring(.net), and hence familiar to a lot of developers, the core code isn't.

When I started the Prana project I decided to create my own, much simpler, implementation because I was afraid that many developers would be scared away by the much bigger codebase of the IoC container. On top of that, the Spring core is a massive amount of code so it was easier for me to understand the ideas behind everything and create a much simpler implementation than to find my way through the jungle and port every line of code.

However as I progress in the development of Prana and get to know more about Spring, there are numerous reasons that the Prana core could actually benefit from being much more like that of Spring.

Here are the main motivations:

- Get started quickly as a Spring developer: Spring developers already know how the IoC container works and what is possible with the API. They don't need to learn a new API to start working with Prana. That is with a few exceptions though, e.g. the async loading of application contexts.

- Make Flex developers familiar with Spring: If you don't know Spring as a Flex developer, working with Prana will get you introduced to it and you will immediately know a great deal about the Spring IoC container. This is also true in my case since most of my Spring knowledge is purely theoretical.

- Implement new features more easily: The Spring Framework is under extreme active development and new features get added often. It will be easier to implement/port these new features if the core is already based on Spring's core.

- Benefit from the Spring know-how: What I mean is that Spring has been out there for a couple of years and that it has proven to be a solid IoC container. The code that drives it has been tested by thousands of developers and many adjustments have been made to perfection it. Having an own implementation is like starting from scratch and it is much likely that somewhere down the road, we will make mistakes that have already been solved in Spring.

- Documentation: In open source projects, documentation is often brought down to a minimum which makes it very hard to attract developers and users. Spring already has numerous books and extended online documentation that can be used a reference and allows us to spend our (already limited) time on development.

- Making Prana a known IoC container: Being able to say that Prana is actually the Spring IoC container for Flex will most likely attract more developers because Spring is a name they trust. On the other hand, this is taking high aims, so we must make sure that Prana is actually as good as what Spring has to offer. Let this be an extra motivation to do a good job.

There are probably more reasons but these are the best ones I could think of. If you have any more you think are worth mentioning or if you are actually thinking about disadvantages, feel free to share them.

If you are interested in helping out or if you are curious to where this is evolving, there is a spring branch in the Prana repository. To get in touch, just drop me a note at info [at] herrodius.com or leave a comment here.

More Prana info: http://www.pranaframework.org


Add to Bloglines - Digg This! - del.icio.us - Stumble It! - Twit This! - Technorati links - Share on Facebook - Feedburner
 

Prana 0.3.1 Released

ActionScript, Flex, Prana 1 Comment »

I'm proud to announce that Prana 0.3.1 has been released. This is a minor release that contains some of the new features and improvements since version 0.3.

  • support for scope (singleton and prototype) on object definitions
  • support for factory objects

General info: http://www.pranaframework.org
Download: SourceForge Download Page

Happy holidays and enjoy this release!

Changes in version 0.3.1 (26.12.2007)

General
* improved documentation
* build file now handles releases

Package org.pranaframework.collections
* IMap and Map now have "get" and "put" methods to support data binding
* IMap now implements ICollectionView
* added MapViewCursor

Package org.pranaframework.config
* AppSettings no longer implements IEventDispatcher because Map now does

Package org.pranaframework.ioc
* added support for factory objects in ObjectContainer through IFactoryObject interface
* added ObjectDefinitionScope enum
* IObjectDefinition now has "scope" getter and setter
* added "scope" getter and setter to ObjectDefinition
* "isSingleton" in ObjectDefinition now alters scope property instead of having a private member
* ObjectContainer.getObject() is now able to return singleton or prototype objects

Package org.pranaframework.ioc.factory
* added "isSingleton" getter to IFactoryObject
* added AbstractFactoryObject base class for factory objects

Package org.pranaframework.ioc.factory.config
* added RandomNumberFactoryObject to return random numbers
* added FieldRetrievingFactoryObject to retrieve static or non-static fields from an object

Package org.pranaframework.ioc.parser
* added scopeAttributePreprocessor to XmlObjectDefintionsParser to set up scope attributes on object definitions

Package org.pranaframework.ioc.util
* added singleton and scope attributes to Constants

Package org.pranaframework.reflection
* added Field as a base class for all fields
* Accessor now extends Field instead of AbstractMember
* Constant now extends Field instead of AbstractMember
* Type now extends Field instead of AbstractMember
* Variable now extends Field instead of AbstractMember

Package org.pranaframework.utils
* TypeConverter.execute() can now return a class


Add to Bloglines - Digg This! - del.icio.us - Stumble It! - Twit This! - Technorati links - Share on Facebook - Feedburner
 

Flex Tools of the Trade

ActionScript, Air, Flex 4 Comments »

Flex
Following up on the FeWeb presentation I did on our Flex development, I thought it was worth compiling a list of the tools and technologies we use. This is certainly not a complete list of all tools out there, but just the ones we use in our day to day development.

All descriptions were taken from the tools' sites.


Tools

- Flex Builder (Plugin): Adobe® Flex™ Builder™ 2 is an Eclipse™ based IDE for developing rich Internet applications (RIAs) with the Adobe Flex framework.
- Eclipse: an open source community whose projects are focused on building an open development platform
- Ant: a Java-based build tool. In theory, it is kind of like Make, but without Make's wrinkles.
- Flex Ant Tasks: provide a convenient way to build your Flex projects using an industry-standard build management tool.
- ASDoc: a command-line tool that you can use to create API language reference documentation as HTML pages from the classes in your Flex application.
- Cruise Control: a framework for a continuous build process. It includes, but
is not limited to, plugins for email notification, Ant, and various source control tools.

Frameworks

- Cairngorm: a lightweight yet prescriptive framework for rich Internet application (RIA) development.
- PureMVC: a lightweight framework for creating applications in ActionScript 3, based upon the classic Model-View-Controller design meta-pattern
- Prana: an Inversion of Control (IoC) Container for the Flex Framework

Unit Testing

- FlexUnit: a unit testing framework for Flex and ActionScript 3.0 applications. It mimics the functionality of JUnit, a Java unit testing framework, and comes with a graphical test runner.
- Flex Unit Optional Ant Task: Allows you to hook FlexUnit into a Cruise Control cycle and extract test reports

Libraries

- Corelib: consists of several basic utilities for MD5 hashing, JSON serialization, advanced string and date parsing, and more.
- Flexlib: a community effort to create open source user interface components for Adobe Flex 2

Remote Gateways

- WebORB: facilitates connectivity between rich clients created with Flex, Flash or AJAX and server-side applications developed with .NET, Java, Ruby on Rails, PHP or XML Web Services.
- Fluorine: an open source .NET Flash Remoting Gateway.


Add to Bloglines - Digg This! - del.icio.us - Stumble It! - Twit This! - Technorati links - Share on Facebook - Feedburner
 
WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Login