0

As far as my understanding goes Modules kann be used to split an Application into different parts.

A big advantage seems to be to be able to load Module after Application Start, to get a better Startup performance.

I personally would like Modules to make me able to have an own Code Sandbox for the Module Code. So neither the Main App Code nor the Module Code should influence each other. But for examples CSS Styles from modules influence the Main Application an visa vers.

My Question: 1. What can I use Modules for beside Runtimeloading ? 2. Are there options to run code in an own sandbox ? For Example via Loading swf assets ?

Dukeatcoding
  • 1,363
  • 2
  • 20
  • 34
  • Did you mean "What is the point of Flex Modules"? – Taurayi Jul 20 '11 at 12:54
  • It would be like that. What is the point of Flex Modules, beside Runtime Loading ? – Dukeatcoding Jul 20 '11 at 13:20
  • possible duplicate of [Flex: What's the difference between an MXML "Component" and an MXML "Module"?](http://stackoverflow.com/questions/1008245/flex-whats-the-difference-between-an-mxml-component-and-an-mxml-module) – splash Jul 20 '11 at 13:37
  • the other question goes in that direction you are right. But it says exactly what i expedet online runtime load / unload... no other sense in using Modules – Dukeatcoding Jul 20 '11 at 13:47
  • ;) seems strange nobody likes my questions but people like the answers... so i guess the questions might be not as boring as they seem – Dukeatcoding Jul 20 '11 at 18:22

2 Answers2

4
  1. What can I use Modules for beside runtime loading ?

You can divide your application into distinct pieces - For example, you may only need to update the shopping cart portion of an application rather than the entire application. This lets you do that without deploying the entire application again. This forces good abstraction and means less regression testing / bugs.

Another benefit is securing the swf files themselves. I've written back end applications where a user might be able to get to the orders screen, but not the user management screen. Because each are a modules, the client never even gets an opportunity to see (or decompile) the user management swf code - because I can validate the user's session server side when they try to load a module. This is an extra layer of protection.

Memory management -its not just about loading the application, but how much processing it takes to have all that functionality loaded at once. If a user only needs one or two screens, why load the other 98 screens?

Portability and code reuse. You might use the "order viewer" module in both a consumer facing application and a back end tool. Those are most definitely not the same application, but they both need the basic functionality of the order viewer. Better yet, an entirely different application could use that same functionality.

  1. Are there options to run code in an own sandbox ? For Example via Loading swf assets ?

There are special considerations for communicating between modules, here is a good read for you:

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

Nate
  • 2,881
  • 1
  • 14
  • 14
  • For the sandbox, I'd like to add that the `applicationDomain` property of ModuleLoader does exactly that. – J_A_X Jul 20 '11 at 17:46
  • Thx 4 your answer Nate extends my perspective on using Modules. And Jax thx for the applicationDomain, i totally got it out of my mind. Maybe that solves my problem – Dukeatcoding Jul 20 '11 at 18:39
1

You can allow a module to deal separately with its styles by creating a new SystemManager for its flexModuleFactory, and you can load it into a separate applicationDomain for security purposes.

Not really an answer to the question you asked, but it addresses the underlying problems you were having.

We used modules at my last job to allow us to develop and add new functionailty on the fly--the path to the module would be stored in a database and loaded at runtime.

HTH;

Amy

Amy Blankenship
  • 6,485
  • 2
  • 22
  • 45
  • nice idea with the modules stored in database, i think the applicationDomain is really the aspect i totaly forgot so far – Dukeatcoding Jul 20 '11 at 19:30