3 Replies Latest reply on May 19, 2010 9:34 PM by Flex harUI

    Flex modules

    ilya_k Level 1

      Flex modules pretty much similar to custom components with one significant difference:

      - custom component compile to class and from collection of custom components you

      can build library and deliver it to  customer.

      - Flex module compiles to standalone runtime loadable swf and such one module - one .swf file.

       

      So, if I deliver to customer a thousand custom components I give him one or two

      files - static swc library and possible swf RSL. Both made out of set of my custom

      components.

       

      So what would happen if I want to go with modules? I do not see any use of modules

      in case like this. I can not deliver thousand loose files. Okay, okay you can say zip them up

      and ask customer to uzip them. This approach does not work either.

       

      In one excellent article, unfortunately old one, I read definition:

      "Modules are libraries of classes  (and assets) that you only need after application startup

      (or choose dynamically at startup)."

       

      But reading Adobe on-line doc and experimenting with modules I do not see how to build library

      out of collection of modules. And even I can build swc, waht would be a point?

       

      Regards,

      Ilya

        • 1. Re: Flex modules
          Flex harUI Adobe Employee

          The create() method returns the top-level class from the module by default,

          but you can pass in the name of any class in the module and it will make it

          for you.

          1 person found this helpful
          • 2. Re: Flex modules
            ilya_k Level 1

            I thought Module compiles itno one class which wraps into swf...

            Guess I do not understand what you, Alex, said. Are you talking factory pattern?

            So, I can have dummy Module and somehow during the load can tell

            create me such-and-such class?

             

            Regards,

            Ilya

            • 3. Re: Flex modules
              Flex harUI Adobe Employee

              Yes, all modules use a factory pattern. ModuleLoader hides it from you, but

              if you look at examples that use ModuleManager directly, you'll see that on

              the READY event, they call IModuleInfo.factory.create().  If you stick a

              com.ilya.MyComponent in the module, you can call

              IModuleInfo.factory.create("com.ilya::MyComponent") and get an instance of

              that clas.