Flex Certification » Flex Frameworks » The Swiz framework
The Swiz framework
The Swiz framework
Swiz is an inversion of control (IoC) framework that provides methodologies for simplifying event handling and asynchronous remote method calls. The main focus of the Swiz framework is to provide a true MVC paradigm in a simple, effective manner. Unlike Cairngorm and PureMVC, it specifically steers clear of imposing Java patterns and does not impose any predefined folder structure.
Creating a project with Swiz involves telling the Swiz framework about your application components. At its core, Swiz is a centralized factory pattern. Components are loaded into this factory through a utility class called the BeanLoader. When the application starts, the factory handles the instantiation of your components.
Swiz also provides dependency management through a custom metatag called Autowire. The Autowire tag is a method of defining dependencies among classes that Swiz then handles for you.
Strengths
Swiz is simple to use and does not impose a predefined structure onto your project. Through its Autowire dependency-injection system, it—like Mate—promotes loose coupling between components and manages dependencies for you. Also like Mate, Swiz uses built-in Flex event handling while providing help in such key areas as facilitating global event dispatching through the use of an internally referenced singleton.
Weaknesses
Again, like Mate, Swiz does not define much of a structure for your application—that’s left up to you to define. Hence, you will have to do your own team coordination to ensure that all your developers are coding in a compatible manner.
Second, because it uses custom metatags, additional steps may be required to set up a project—for example, setting a few extra compiler arguments. These steps are not difficult, but it is something that the Swiz framework requires that the other frameworks don’t. The documentation specifically mentions Flex 2 users, so this may not be an issue for versions later than Flex version 2.
Resources
- Documentation and examples
- Podcast interview with Swiz framework creator Chris Scott
Filed under: Flex Frameworks








