Archive for May, 2006

The World’s Smallest Tag?

If you are developing an MVC application with Flex, sooner or later you are going to want to trigger some functionality in your view when a property in your model changes. A common approach for achieving this is to use a binding tag in conjunction with a property setter in your view component. You bind your view’s property setter to the relevant model property and put your view logic in the setter function. Every time the property changes, your view logic executes.

I have never been particularly satisfied with this approach because it requires me to add a ‘fake’ property to my view component. So I created the Observe tag as a possible alternative, and I think it may also qualify as the world’s smallest tag:

public class Observe
public var handler : Function;

public function set source( source : * ) : void

You use the tag as follows:

<util:Observe source="{ model.myProperty }"
handler="{ this.myFunction }"/>

Because this is such a large and complex component, I need to call on the ever-resourceful Flex community to test it. So feel free to use it in your applications if you want to, and please let me know if you find any bugs.

Update: Please check Alex Uhlmann’s blog for a more recent update of the Observe tag.

Flex 2 Readiness Event

Earlier this month I had the opportunity to attend the Flex 2 Readiness Event at Prisma IT’s Rotterdam office. The main goal of the four day course was to provide a broad overview of Flex 2’s features. There were fourteen other attendees, from a variety of backgrounds and nationalities: a few from Adobe, a few more from our partners, plus a few of our customers.

The course began with a comprehensive overview of the various visual controls, components and containers that are available in the Flex 2 Framework. For each new concept we walked-through an example within flex builder that demonstrated the idea.

The second part of the course was more focused on accessing server-side resources using web-services, Flash remoting and Flex Data Services. In this case the example exercises used a local jrun or cold fusion installation.

Many of the new Flex 2 features were covered in detail during the course, including contraint based layouts, E4X, drop-in item renderers and the new collection classes. In addition, changes in behaviour from Flex 1.5 were also highlighted, such as the more explicit binding mechanism and the new requirements for event dispatching.

As with the software, the course is still a beta version so to some extent we were the guinea pigs. But despite a few teething problems, the pace remained consistent. There was also talk of an additional day of lab training that was still to be added to the course, which would give participants the opportunity to gauge their understanding of the material.

Overall I felt the course represented a very thorough introduction to the Flex 2 feature set and would suit a broad audience. A more advanced course is also being planned that may appeal to more experienced RIA and enterprise application developers.