• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Loading RSLs from Modules

Contributor ,
Jul 06, 2010 Jul 06, 2010

Copy link to clipboard

Copied

For a while I've been wanting to be able to load an RSL from a Module.  The reason for this is that some modules require some RSL but that RSL is not needed in the MainApp.

I've googled alot on this subject and can't find any information that will show that this is possible, but now reading up on the enhancements of the Hero Sdk (http://opensource.adobe.com/wiki/display/flexsdk/RSL+Enhancements) it seems to be possible.

To be specific here is a quote from the info

3.   Going into Flex 4 we only expected sub-applications and modules to  re-use the RSLs loaded by the main application. But now we see modules  that are being used to load custom RSLs. Expecting the main application  to load all of the RSLs won't work anymore. We are also seeing cases  where modules want to be independent of the application and load all the  RSLs it needs without regard for which RSLs the application is loading.  Today this can result in multiple loads of the same RSL.

From reading that, it is possible.  Can anyone please point me in the direction on to how to acomplish that.  How to load an RSL that a module needs when loading the module?

Thanks,

Art

TOPICS
Developers

Views

1.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Jul 28, 2010 Jul 28, 2010

I think the module config file will only work in Flex4. In Flex3 I think you will need to create a Flex Project just for your modules so you can configure the RSLs in the project's Build Path settings. You would ignore the application in this project.

-Darrell

Votes

Translate

Translate
Explorer ,
Jul 26, 2010 Jul 26, 2010

Copy link to clipboard

Copied

In 2008 and 2009 I was heavily involved in trying to develop modular Flex and AIR applications.  I have not been heavily involved for the past 10 months, so I don't know whether I can offer any help or not.  Some things have changed with Flex 4 and AIR 2, and while I have only spent a couple of days trying to catch up, it is very clear that Flex 4 and AIR 2 ended up being surprisingly different from what I was doing with Flex 3.3, AIR 1.5 and Gumbo.

If you would like to chat about it, please send me an email:  tcorbet at ix.netcom.com.  I recommend that for two reasons.  First, I was never able to get much help from any of the myriad of Adobe Forums in trying to discuss the concepts of modularization as they apply to an AIR application.  There was that lengthy white paper for Flex, but trying to get specific help on code-level implementations was not successful.  Second, since what I think I may know about the topic is so apt to be wrong, it would be better just to confuse you rather than everyone!

That said, for some perspective, in my mind the topic of RSL loading covers two closely related matters.  One has to do with the RSL support for the various Open Source frameworks.  While I was wrestling with trying to manage which versions of which SWZ and/or which SWC would be needed by various sub-applications, I asked why in the world we had to do this anyway.  So, I am happy to see -- but have not yet tried to re-engineer my solutions -- that Adobe has agreed to host those RSL files rather than asking each of us to do it.

The other RSL -- my frame of reference, maybe not yours -- topic is the managment of your own modular application code.  I finally ended up with an application manifest file that could be used to determine the current release level of each 'module' and each 'SWC/SWZ' installed on the users desktop.  Then I could make a quick check of the current release level available on the server, and push out only whatever library needed to be refreshed.  If nothing needed to be refreshed, the load was just local, otherwise it was downloaded, inserted into the user's file system and then loaded on demand, only if the user was working in some part of the application for which that library was required.  If the user was not working with that sub-application, he would not see the overhead of checking for or installing the updated library code.

So, if those are things on your mind, maybe I can help, but since the Adobe developers seem to have a much different perspective on the dangers of loading code into a desktop or web-centric application, I am pretty sure that what was working for me 10 months ago will not work with the Flex 4.1, AIR 2.0.2, and I will once again be looking for some white paper where someone tries to explain all the reasons for all those sandbox bridges.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 28, 2010 Jul 28, 2010

Copy link to clipboard

Copied

Thanks tcorbet,

  My question is geared more towards my own RSL than the framework specific RSL, but it should apply to both.

  It's not about caching RSL in a Air app though.  Although not necesarely simple, it isn't hidden, not to complicated.

  My question is about loading RSLs at runtime.

  It is my understanding that RSL must be loaded by a Flex app at startup.  But I don't wish to load ALL the RSLs at startup.  Although the docs say you can't load them after startup, from the post mentioned above ((http://opensource.adobe.com/wiki/display/flexsdk/RSL+Enhancements) ) I deduce that it can be done, and I wish to figure out the how.  It indicates that this will be a feature of 4.5 but it hints that it can be done now, although not in an obvious way.

Let me give an example:

Let's say I have a library that has methods that are used by different modules.

So basically I would create an RSL that holds those methods and load it at startup so they are available when ever any of the modules need them.

But what if the user doesnt' use doesn't invoke any of the Modules that use that RSL?

I loaded the RSL for nothing.  Loading isn't the really bad part, downloading it is.

So what I want is to load the RSL only  when one of the modules that needs it  is loaded.  Regardless if it's an AIR app or a Web App.

Thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Jul 28, 2010 Jul 28, 2010

Copy link to clipboard

Copied

There are two ways to compile a module to load an RSL.  One from the command line and one from Flash Builder.

1. From the command line specifiy your RSL using a config file. See flex-config.xml on how to specify an RSL and use "-load-config+=myConfig.xml" at the command line. You can also prefix the name of the config file with the name of the module so the config file will be loaded automatically by the compiler without the need for the load-config option. For example, if your module is named Module1.mxml, the config file would be named Module1-config.xml.

2. In Flash Builder you can take the Module1-config.xml file and put it in the source directory with your module.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 28, 2010 Jul 28, 2010

Copy link to clipboard

Copied

Thanks!!!

Does this work on Flex Builder 3.5?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Jul 28, 2010 Jul 28, 2010

Copy link to clipboard

Copied

LATEST

I think the module config file will only work in Flex4. In Flex3 I think you will need to create a Flex Project just for your modules so you can configure the RSLs in the project's Build Path settings. You would ignore the application in this project.

-Darrell

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines