Flex 3 Modules -> What are they for?
In a recent project, I attempted to implement a flex interface to an e-learning application. The basics of the application are as follows:
- Video game style e-learning application for a medical school.
- Administrative game scenario builder and cms
I thought I would use Flex Modules:
- Main Application – handles authentication and main navigation
- Admin Module
- Users Admin Module
- Foo Admin Module
- Bar Admin Module
- Game Module
- Admin Module
This seemed logical today. I could load the modules and unload them as needed. This way I could have one application and all the resources available, but never loading all the overhead unless I needed it. That way, if I just looked on to do the Game, I would only use those resources and not have all the memory being used by the admin features.
I was wrong. Modules do not work that way. You can not load a module that registers any events, or many other common memory allocating tasks, and unload them to release the memory. Flex holds onto many instances which cause a number of problems, many of which are outlined here: Alexs Flex Closet.
Furthermore, If you try to use a class in a loaded module that hasn’t been registered by the main application, you must go to the main application and register it, otherwise you get an error on things like Lists, ComboBoxes. This is not a lot of additional work but, to me, doesn’t seem like the way a module should work.
If I can’t load and unload modules without incurring memory leaks or errors, what good are modules.
Adobe, please fix this. It is far more important than all the time/money you are spending making Data Intensive Web Apps accessible for Designers. Just make it work for developers first, PLEASE, or we will find another technology to use.
Indeed..working on something similar right now…and memory leaks with module seems to be inevitable.
So to quote you:”Adobe, please fix this. “