3 Replies Latest reply on Nov 14, 2011 9:00 PM by highlightscript

    What is the advantage of module over component

    194642537 Level 1

      Hi All,


         Please let me know what is the advantage of module over component.....


         When exactly should a module be used and when should a component be used.



        • 1. Re: What is the advantage of module over component
          drkstr_1 Level 4

          A Module is compiled into a separate SWF that is loaded at runtime, presumably so they can be switched out or added to later, without having to rebuild the entire application.

          • 2. Re: What is the advantage of module over component
            Ansury Level 3

            Don't forget the critical advantage - such a "modular" application (if your app is very large) means that the initial download size can be greatly reduced.  If the user isn't using 80% of the UI code, making them download all that extra stuff is pointless.  It can help save on bandwidth and download overhead, when needed.  IMO in the "typical" case (especially over an internal intranet), it's overkill and not needed, but this very much depends on the project and requirements.  It does add a bit more design complexity and requires some planning to do right.


            A component is just a custom control, usually extending functionality of an existing UI component.  They're nice for providing rich/complex functionality in a re-usable package, in a very encapsulated and object oriented manner.  I'm told (or I've read) that the ability to do this easily is one of the major strengths of Flex compared to competing technologies.

            • 3. Re: What is the advantage of module over component

              Main difference is, components exist as a part of main swf but modules exist as different file. Again modules can contain component not the other way