R – Flex Project Structure

apache-flexprojectreferencestructure

I am trying to create a large flex project. This Project consists of a CORE application, and other sub-applications.

The CORE application should contain information that will be shared by all other projects (e.g., link to database, data manager which loads data from the database, application information like height width colors fonts… etc.).

The sub-applications each has a certain task. Each sub-application is a large project by itself so I don't think its a good idea to put all code inside one HUGE project.

The CORE project should run the main application, and through a navigation menu, I should be able to click and run other sub-applications.

Is there a way to created the CORE application to reference those sub-applications so that I can run them inside of the CORE. At the same time, those sub-applications should reference the CORE applications to get the NetConnection to the database and other important information that they might share?

What is the best way to structure this project?

Thanks,

Best Answer

There's two factors to consider.

  1. Where does the code live
  2. Where does the compiled output of that code live.

It likely is a good idea to have all of the source code live in a single code tree. It's way easier to maintain like that. You could put each sub-application in a separate AS3 package.

It's also likely a good idea to separate the compiled output of that code. Make your core application the main flex application, and then make each sub-application a Flex module. The core app can load modules and manipulate them like any other AS3 based class. A great thing about this, is during debug time you can choose to only build the limited set of modules that you care about at the time.

I would highly suggest building your releases through some kind of automated ANT build script and not through Flex Builder.

We have one project that exceeds 150k lines of code that is managed exactly like this. That's not huge in terms of software-engineering, but it's pretty big in the Flex world.