开发者

What is the sense of Flex Modules [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

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 ne开发者_开发知识库ither 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 ?


  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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜