December 10, 2009
Writing Genuinely Reusable Flex Components
On larger projects and within enterprises, there's often a case for extracting a set of reusable components into a Flex library project. In theory, the same components can be reused across modules and sub-applications of multiple Flex or AIR clients, bringing greater consistency and more rapid development. However, in practice there are some common mistakes that limit the reusability of components. This post explains what makes a component genuinely reusable and highlights some techniques from the Flex SDK that can be applied to your own components to make them more reusable.
Continue reading "Writing Genuinely Reusable Flex Components"
Posted by tsugden at 9:18 AM
| Comments (0)
November 23, 2009
Modularity in Flex Applications
There has been talk recently about the trend towards inversion-of-control frameworks in Flex. In addition to this, a higher-level movement can be seen towards modularity frameworks. Such an approach to architecture can bring many benefits, particularly in enterprise settings with larger teams and formal release processes. This post explains what modularity means in the context of Flex and discusses some of the benefits and options available for implementation.
Continue reading "Modularity in Flex Applications"
Posted by tsugden at 10:32 PM
| Comments (0)
September 29, 2009
Vote for Morgan Stanley Matrix!
Morgan Stanley Matrix has reached the finals for a MAX Award in the Enterprise Productivity category. You can view the vignettes and cast your vote at:
Public voting has started and the voting will be live until Tuesday, October 6, when the winners will be announced at the event. For more info about Morgan Stanley Matrix, see my earlier blog post or come to the Building Morgan Stanley Matrix session at MAX next week.
Posted by tsugden at 1:59 PM
| Comments (1)
September 21, 2009
Morgan Stanley Matrix at MAX
Next month at Adobe MAX 2009 in Los Angeles, Børre Wessel (Lab49) and myself will be presenting Matrix, the next-generation sales and trading platform from Morgan Stanley.
Continue reading "Morgan Stanley Matrix at MAX"
Posted by tsugden at 9:40 PM
| Comments (2)
September 13, 2009
Coming Soon: Cairngorm 3
Cairngorm is about to undergo a transformation that will broaden its scope and increase its value to clients and partners. Instead of centering around a specific implementation of the Model-View-Controller pattern, Cairngorm 3 will consist of a set of best practices, tools and libraries, many of which apply across frameworks. This is the knowledge gathered by the Adobe Technical Services organization and partners over the last five or six years, condensed and presented to help others to deliver successful Flex projects in the enterprise.
Continue reading "Coming Soon: Cairngorm 3"
Posted by tsugden at 8:57 PM
| Comments (5)
September 4, 2009
Eliminate Common Bad Practices with FlexPMD
Adobe Technical Services are pleased to release FlexPMD to the community. FlexPMD is a new open-source tool for improving code quality. It works by analyzing ActionScript and MXML source files to identify common bad practices, like over-long classes or functions, reliance on magic strings, unused parameters, and many other programming mistakes or misjudgments. It can even spot code that might be causing performance problems, and furthermore, the ruleset can be customized and extended, to include rules specific to the coding conventions of your own project.
Continue reading "Eliminate Common Bad Practices with FlexPMD"
Posted by tsugden at 7:21 AM
| Comments (0)
August 24, 2009
Applying the Presentation Model in Flex
Introduction
The purpose of the Presentation Model design pattern is simple to grasp: it’s a way of moving state and logic out of a view component and into another class, where it can be developed, comprehended and unit tested more easily. The pattern promotes a clean separation of concerns, helping to keep MXML views as structural definitions, free from Script-block logic. However, there are several ways to apply presentation models in Flex. Some of these can help us to build simpler, more testable systems, while others may lead towards entanglement and maintenance difficulties.
For a comprehensive introduction to the Presentation Model pattern and a comparison between it and other presentation patterns, please refer to Paul Williams' blog series on the topic. At Adobe Professional Services, we have found the Presentation Model to be well suited to Flex, since it takes advantage of language features like bindings and in-line event handlers, while side-stepping some of the difficulties of unit testing display objects.
This article discusses two approaches to applying the Presentation Model -- hierarchical and componentized -- and makes a recommendation in favour of the latter.
Continue reading "Applying the Presentation Model in Flex"
Posted by tsugden at 9:32 PM
| Comments (5)
August 11, 2009
Best Practices for the Flex Logging Framework
Introduction
The Flex Logging Framework is easy to learn and flexible to use. It supports many different scenarios, from helping developers to debug their code, to sending the details of production application errors over the wire to a remote server for monitoring. To learn the basics of the Logging Framework refer to the latest Flex Developer Guide and the Flex Logging Framework chapter of Professional Flex 3. This document describes some best practices for applying the Logging Framework on enterprise projects.
The APIs provided by the Logging Framework are simple, but they need to be used properly to get the best out of them. If care is not taken, the benefits that logging can provide for debugging and monitoring an application in production can be lost. Performance problems can even be created. This article provides a set of best practices to keep the developers in your team on the right track.
Continue reading "Best Practices for the Flex Logging Framework"
Posted by tsugden at 9:15 AM
| Comments (2)
July 18, 2009
A Declarative Approach to Flex Popups
Yaniv De Ridder and myself have developed a small Flex library for opening and closing popups. Instead of using the PopUpManager directly and writing script-block logic to manage their creation and removal, a pair of simple MXML tags are available for declaring within view components. Here's the "Hello World" of declarative popups:
<popup:PopUpWrapper open="{model.openPopUp}">
<mx:Label text="Hello World"/>
</popup:PopUpWrapper>
The PopUpWrapper tag is a non-visual component that manages opening and closing the popup. When its open property is set to true, a popup is opened containing the component wrapped by the tag; in this case a Label. When the open property is set back to false, the popup closes again. Alternatively, the component may dispatch an Event.CLOSE event, which will be handled by the PopUpWrapper itself.
This approach helps to keep MXML views components clean and free from ActionScript logic, whilst removing duplicated code wherever the PopUpManager is needed. The opening and closure can be controlled conveniently through bindings, as above, which plays nicely with presentation models. There are also simple ways to control the life-cycle of the popup and to apply special behaviors, such as effects that play while it opens and closes.
The remainder of this post covers the two components available -- PopUpWrapper and PopUpFactory -- explaining the differences between them. The library, source code, unit tests and a sample application are available for download here:
Continue reading "A Declarative Approach to Flex Popups"
Posted by tsugden at 10:07 PM
| Comments (4)
July 6, 2009
The Trend Towards Inversion-of-Control Frameworks in Flex
Last year I wrote three chapters about the Cairngorm MVC framework for a new Flex book, Professional Flex 3, published by Wrox Press. Cairngorm has been widely adopted on enterprise projects, so it was important to explain its workings and cover the best practices and common pitfalls. If you’re a developer who moves between clients and projects, this is important knowledge to have. However, with more time and pages, I’d have liked to devote similar attention to the other Flex frameworks now available.
Over the last few years, the Flex framework space has become well served with alternatives to Cairngorm, each offering their own take on the challenges of RIA development. While Cairngorm is rooted in design patterns from the Java enterprise world, some of the newer framework creators have taken a fresh approach, reflecting on the language features and special capabilities of ActionScript and the Flex SDK, then building from the ground up, taking advantage of features like event bubbling, declarative MXML and metadata.
Continue reading "The Trend Towards Inversion-of-Control Frameworks in Flex"
Posted by tsugden at 8:35 AM
| Comments (0)