views:

647

answers:

4

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,

A: 

Your best bet would be to put the CORE stuff you're suggesting into a library project. Keep the front end of the application in a Flex Application Project, but all of the data and methods that need to be shared would be easily available to the main application and all of the other modules or applications.

Then in the project settings for your main app and the other applications, you can link to the library project.

If you're planning on using a framework you can also look into the PureMVC Multicore library. It's a bit more complicated than the solution I provided above, but is built specifically to allow the sharing of data and notifications between separate applications.

Matt Guest
A: 

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.

Marc Hughes
A: 

It sounds like you want to use Flex modules to keep your sub-applications self-contained but still able to interact with the core application.

http://livedocs.adobe.com/flex/3/html/help.html?content=modular_2.html

This will allow you to keep your core application SWF fairly small and load the subapplications on demand.

Typically modules are stored in the same project as the main application but each app / module is compiled into a separate SWF either by Flex Builder or an automated build tool such as Ant or Maven.

cliff.meyers
A: 

I'm working on ERP Project, i would like to seprate all modules such as: PO, SO, Inventory.... in to Library

but i have big issues. Let say: - In the OP module i have a method: getPOInfo() - Module Inventor, i have methods: GetItemist() and GetItemFormOP() and in this module i want to call method getPOInfo() from OP, simple i only referrence module Inventory to module OP. - But back to module PO, if i want to call method GetItemist() from module Inventory. i cann't, do guys have any ideas? many thanks

thien