A module is a factory of potentially many instances, so multiple requests to 
load the same url are ignored and the same factory is returned to create the 
instance.  You might try adding dummy url variables to see if you can fool 
ModuleManager into loading the module SWF again.

Alex Harui
Flex SDK Developer
Adobe Systems Inc.<http://www.adobe.com/>
Blog: http://blogs.adobe.com/aharui

From: [email protected] [mailto:[email protected]] On Behalf 
Of Everson Alves
Sent: Tuesday, August 18, 2009 4:38 PM
To: [email protected]
Subject: Re: [flexcoders] Singletons and Modules - Application domain problem



It's a good post but doesn't solve my problem without a lot of changes in the 
whole application. What i was really wanting from here is to know why I can't 
load the modules into different application domains. I'll use a ModelLocator 
factory per conversation instead of Singleton, but that requires changing in a 
lot of places, mainly propageting the conversationId all components and classes 
that need to access the modelLocator.
On Tue, Aug 18, 2009 at 6:35 PM, Everson Alves 
<[email protected]<mailto:[email protected]>> wrote:
I'll have a look at it say the outcome here. Thanks.

On Tue, Aug 18, 2009 at 6:03 PM, Rick Winscot 
<[email protected]<mailto:[email protected]>> wrote:


Take a look at a good write-up by Steve Brownlee...

http://www.fusioncube.net/index.php/cairngorm-sharing-a-common-modellocator-with-modules

With the added security restrictions... Your singleton implementation may need 
to be hardened to prevent multiple instance... Etc. This example may help as 
well.

http://www.quilix.com/node/5

Cheers,

Rick Winscot




On 8/15/09 12:11 PM, "Everson Alves" 
<[email protected]<http://[email protected]>> wrote:




Hello guys,

I'm facing a weird problem. I'm working with flex Modules that are tide mxml 
components . Using ModuleManager to load the modules. If I load using 
moduleInfo.load(ApplicationDomain.currentDomain) it loads fine but as I want to 
use the module as independent sub applications and they use the same class 
definitions that doens't play nice with singletons (ModelLocator) . When 
loading using  moduleInfo.load() expecting that it uses it's own 
ApplicationDomain it loads, dispatches  ModuleEvent.READY event but 
moduleEvent.module.factory.create() gives me null. I also tried 
moduleInfo.load(new ApplicationDomain(ApplicationDomain.currentDomain)) but 
this case dispatches a  ModuleEvent.ERROR saying that file isn't a loadable 
module or something like that. An detail that might be important is that the 
module is marked to be optimized to my application in compilation.

thanks in advance.



--
Jhonny Everson



--
Jhonny Everson

Reply via email to