Sean is a highly sought after Flex developer and consultant with extensive ActionScript programming experience, including more than five years developing for the Flash platform and over a decade of experience designing and developing desktop and web based applications. Business owner, technical author, blogger and Adobe Flex/AIR enthusiast, Sean is an Adobe Flex Developer Community Champion and the creator of the ActionScript Cheatsheets. Sean has posted 2 posts at DZone. View Full User Profile

Flex best practices – Part 1: Setting up your Flex project

03.11.2009
| 42168 views |
  • submit to reddit

This is the first part of my series on using and applying best practices to your Flex development process. This article will focus on best practices for setting up your Flex project.

Why follow best practices? During your Flex development career, your hands will touch many projects. Not all projects will be created from scratch. More than likely you will be working on an established codebase that has been built up over time by different developers working in different stages of their careers. You will be facing projects that may have already begun or have already been released and now need to be refactored, changed, and updated. Time and time again, you will find yourself being thrown into the middle of the development process for various projects. Because of this, it is critical that the project has been started using best practices. Otherwise, you will be spending additional time making sense of the project and understanding the codebase rather than making the requested improvements or changes. This additional time can increase the cost of a project and dramatically detract from the task at hand. For these reasons, the Flex development community has established a set of common best practices for Flex developers to use. Following these best practices improves the clarity of a Flex project and enables Flex developers to focus on innovation rather than learning a myriad of nonstandard development approaches.

Whether you are a contractor or an employee, these best practices will serve as a set of rules and your roadmap to navigating a project's structure, organization, and code format. This article explores common techniques and conventions adopted and used throughout the Flex development community.

Please note that the techniques and practices outlined in this article should be used and adopted where they make sense and clarify the development process for you and your team.

Requirements

In order to make the most of this article, you need the following software:

Flex Builder 3
 

If you are willing to sacrifice the powerful tool set provided by Flex Builder 3.0 standalone or plug-in, applications can be developed using only the Flex 3 SDK.

The practices covered in this article should be followed regardless of which setup you use.

Prerequisites

Previous Flex experience is not mandatory for this article. However, some previous application development experience will be helpful.

Using workspaces for project organization

Follow the best practices below to use workspaces to organize your Flex projects:

checkmarkUse workspaces to keep your Flex projects organized.

A Flex workspace is basically just a directory on your computer that stores a collection of Flex projects. Workspaces are a good way to organize multiple Flex projects. If this is your first Flex project, I recommend using the default workspace, at least until you are comfortable with what a workspace is and how it relates to your computer's filesystem. A common issue that can arise for beginners when the workspace is changed is that the project files can become difficult to locate. The location can always be found within Flex Builder, but if you're not sure where to look or what a workspace is, questions can surface. As you mature as a developer, you will be held responsible for the management of multiple Flex projects. Setting up a fresh workspace for each project may be the best approach to reducing clutter and enabling you to focus on one project at a time. Be aware that Eclipse preferences are often stored in the workspace, so key bindings need to be set for each workspace; and that can be frustrating if you stray from defaults.

Be sure to note the locations where Flex is storing your project files. The default Flex Builder 3.0 workspace locations are:

Windows XP: C:\Documents and Settings\<User Name>\My Documents\Flex Builder 3

Mac OS X: /Users/<User Name>/Documents/Flex Builder 3

Linux: ~/workspace

To find more information regarding Eclipse workspaces, see Setting the Workspace.

AttachmentSize
adobe_fx_download_button_100x30.jpg1.49 KB
Published at DZone with permission of its author, Sean Moore.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)