Lately I've been putting together a fairly simple Application Starter Kit for my own use when starting up a new Flex 2 application.
Generally I'm not building gigantic enterprise-level applications, so a framework like Cairngorm which can be very useful for large-scale apps adds more complexity than I need.
Still I want the apps to have a familiar architecture and be easy to maintain. I'm also big on standardizing things like Error handling and Event dispatching for each app, so the Kit will include some support for that too.
The main elements I find myself repeating in each Flex 2 app include:
- A separate Model class to store data that will be used by other classes in the application.
- A separate Services class for encapsulating service calls and fault handling.
- An AppEvent class for passing application data when dispatching Events.
- An AppError class for defining and reporting application-specific errors.
I've also been repeating some patterns when developing the UI display code, including:
- A ViewStack control scheme that switches the view given the view component's id or index
- A simple dynamic Menu scheme
- Stupid Layout Tricks, like getting components to expand outside their containers, or using data binding to roll your own layout logic
As I formalize each of these elements I'll post a quick article about it here on Flashlit. After a few of these articles we should have small set of files that anyone can use to jump-start the development of simple service-enabled Flex 2 apps.
If you find yourself reusing certain modules, classes, or techniques over and over again in Flex 2, let me know, and maybe we can add something similar to the Kit.
I think this approach is a very sane one. If you keep refining the kit, you'll eventually have a framework :)
Posted by: Greg Fuller | 30 July 2006 at 09:44 AM
Yes it's a grass roots approach to building a simple framwework. Though it'll probably end up more like a toolbox, with a variety of different things to apply depending on the circumstances.
Posted by: Rob Dixon | 30 July 2006 at 03:52 PM