开发者

Using RSLs with Modules

We are building a fairly complex application that we need to be able to release different parts of at different times. To help us solve this problem we are using RSLs and Modules.

so let me describe the projects (names have been changed to protect the innocent)

core (rsl)

client (application)

groceries (module) groceriesCore (rsl)

bakery (module) bakeryCore (rsl)

We have one application client that loads the areas of the application as modules. We have a core RSL that does things like login and holds entitlements and provides an API for the modules to access this sort of state and also to communicate with each other.

When we load client we only want the core rsl to be loaded as that is that is currently required. When the groceries module is loaded we want the groceries rsl to load and likewise when the bakery module is loaded we want the bakeryCore rsl to load.

In reality this isn't what happens. If we set the projects up like that at run time the core rsl loads at application startup but the module RSLs do not load when the module is loaded. If we run an application from the project that houses the groceries module then he rsl loads when the application loads but not when the module does.

We need a way of loading the rsl when the module load开发者_如何学编程s.

At the moment we specify groceriesCore and bakeryCore in the client application so they all load when the client loads. This is obviously not a good idea as when we add another 30 departments we don't want all these departments being downloaded at application startup - we only want them to be downloaded when they are required - when the application loads.

How do I achieve this? (other than a horrible custom rsl loader type thing).


RSLs can only be loaded at application startup. What I've done in the past is to make things like your groceriesCore another module instead of an RSL. Then you just specify it somewhere as a dependency for the groceries module so that when you want to load groceries it will check if the groceriesCore module is loaded and if needed, load it.

Managing the dependencies of modules is not something that Flex manages for you. So you will have to do it manually. Or perhaps the Potomac Framework will help with it's OSGI-ish approach.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜