InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

Flex Development with the Swiz Framework

Posted by Jon Rose on Feb 17, 2009

Sections
Architecture & Design,
Development,
Enterprise Architecture
Topics
Web Frameworks ,
Rich Client / Desktop ,
Java ,
Rich Internet Apps ,
Web 2.0
Tags
Flex ,
Flash ,
Adobe ,
Adobe Integrated Runtime ,
Spring

The Adobe Flex and AIR community continues to mirror many of the trends of the early Java community, with numerous individuals offering frameworks that aim to simplify or improve Flex development.  This post reviews the Swiz Framework, which models itself after many of the principles found in the SpringFramework for Java.  The Swiz framework was developed by Chris Scott, and is offered under the Apache License 2.0.

Christophe Coenraets, an Adobe Technical Evangelist, discussed the Swiz Framework and detailed its usage in a recent blog post.  Christophe began by describing the Swiz Framework:

At his core, Swiz is a simple inversion of control framework. Using an IoC framework, the components of your application (for example, Views) don’t instantiate or even look up their dependencies (the objects they work with). The framework injects those dependencies when the components are created (hence the term “Dependency Injection” also used to describe this approach). The result is looser coupling and more reusable components. The components managed by the Swiz IoC framework are called beans.

In Christophe's sample application he shows the Spring like syntax for injection:

Swiz uses the [Autowire] custom metadata to inject beans into other beans and views.
In inSync, the contactService RemoteObject is injected into ContactController.as as follows: 
1
2
[Autowire(bean="contactService")]
public var contactService:RemoteObject;

… and contactController is injected in the Views. For example, in ContactForm.mxml:

1
2
[Autowire(bean="contactController")]
public var controller:IContactController;

In a recent review of the Swiz Framework, Tony Hillerson discussed the Autowiring features:

In case you didn’t notice, this Autowire thing is sweet. We don’t have to worry about where this model comes from. We don’t have to think about if it’s a Singleton or not. All we know is that we want a model, and the framework will make sure we have one when we need it. One note of caution: the property has to be marked public or Swiz won’t be able to assign to it.

Both Tony and Christophe concluded that Swiz is a framework that is easy to use, Christophe saying:

Swiz was easy and enjoyable to work with. It is also non intrusive and definitely introduces some interesting ideas.

To learn more about Swiz and its features check out the project tutorial.

New Swiz Framework 1.0 by Sohil Rupani Posted
  1. Back to top

    New Swiz Framework 1.0

    by Sohil Rupani

    Hi ,
    This is a link to old Swiz 0.6 . Check out the Tutorial for new Swiz Framework 1.0
    xebee.xebia.in/2011/01/12/swiz-framework-1-0/

Educational Content

New-age Transactional Systems - Not Your Grandpa's OLTP

John Hugg discusses high volume transaction processing applications with high and low frequency profiles, and how VoltDB can be used for that purpose.

Cool Code

Kevlin Henney examines code samples to see what can be learned from them starting from the premise that one won’t write great code unless he knows how to read it.

Collaboration: At the Extremities of Extreme

Jason Ayers share the observations he made watching a team of developers collaborating in real time on the same code base, pushing XP, pair programming and continuous integration to their extremes.

Yesod Web Framework

Michael Snoyman presents Yesod, a web framework written in Haskell and containing a web server, templating, ORM, libraries (templating, gravatar, etc.).

Transactions without Transactions

Richard Kreuter and Kyle Banker on how to avoid classical RDBMS transactional systems by using compensation mechanisms, transactional messaging or transactional procedures.

Attila Szegedi on JVM and GC Performance Tuning at Twitter

Attila Szegedi talks about performance tuning Java and Scala programs at Twitter: how to approach GC problems, the importance of asynchronous I/O, when to use MySQL/Cassandra/Redis, and much more.

10 tips on how to prevent business value risk

One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.

Interview: Software Systems Architecture: Working With Stakeholders Using Viewpoints and Perspectives

InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.