I faced a situation where multiple instances of the same module are
required to run parallel. Each of my module has a controller of its
own. Now, dispatching a cairngorm event calls the command as many
times as the number of instances of the same module are running. To
get around this pitfall, I am keeping an associative array at the
application level and add the module controller reference to that
array.
I do this in the preinitialize listener of the module:
if (Application.application.controllers["myModule1Controller"] ==
null)
Application.application.controllers["myModule1Controller"] = new
MyModule1Controller();
And then when all the instances of the same module are unloaded, I
remove the reference:
Application.application.controllers["myModule1Controller"] = null;
(Cairngorm ensures that all cairngorm event listeners use
weakReference as true so memory management is automatically taken care
of. Of course, these can also be explicitly removed while unloading.)
so, this ensures that just one instance of the module controller is
present and that too at the app level. This is just a workaround, any
better idea is welcomed.
On Apr 8, 10:07 pm, Sharad M <[email protected]> wrote:
> Hello,
>
> I followed these link for my application.
>
> May be these will help u.
>
> http://etweb.wordpress.com/2008/11/16/ok-ok-here-is-a-quick-example/http://www.fusioncube.net/index.php/cairngorm-sharing-a-common-modell...http://my.opera.com/flexcoders/blog/2009/01/27/cairngorm-frontcontrol...
>
> Regards,
> Sharad M.
>
> On Apr 8, 2:04 am, Akshar Kaul <[email protected]> wrote:
>
> > thanks for your reply.
>
> > do you know of some links where i can find detailed information.
> > i tried google but the information is scattered around and it is taking time
> > to figure out each issue.
> > is there some tutorial or some code sample available that tells step by step
> > guide of using modules with cairngorm.
>
> > thanks again
>
> > Akshar Kaul
>
> > On Thu, Apr 8, 2010 at 11:39, Vaibhav Seth <[email protected]>wrote:
>
> > > while integrating key points to keep in mind:
>
> > > keep useWeakReference = true in event listeners.
> > > removeCommand() after unloading the module.
> > > removeListeners b/w the main application and modules while unloading them.
>
> > > Memory leakage can come up, if the application is big in size or no. of
> > > modules are good in number. You have to take care of the architecture and
> > > follow the good programming standards.
>
> > > On Wed, Apr 7, 2010 at 7:27 PM, Akshar <[email protected]> wrote:
>
> > >> my application uses cairngorm model and blaze ds. i want to divide it
> > >> into modules but am facing many issues. can anyone provide some link
> > >> to step by step integration of cairngorm and modules.
> > >> thanks in advance.
>
> > >> --
> > >> You received this message because you are subscribed to the Google Groups
> > >> "Flex India Community" group.
> > >> To post to this group, send email to [email protected].
> > >> To unsubscribe from this group, send email to
> > >> [email protected]<flex_india%2bunsubscr...@googlegroups.com>
> > >> .
> > >> For more options, visit this group at
> > >>http://groups.google.com/group/flex_india?hl=en.
>
> > > --
> > > Thanks,
> > > Vaibhav Seth.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "Flex India Community" group.
> > > To post to this group, send email to [email protected].
> > > To unsubscribe from this group, send email to
> > > [email protected]<flex_india%2bunsubscr...@googlegroups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/flex_india?hl=en.-Hide quoted text -
>
> > - Show quoted text -
--
You received this message because you are subscribed to the Google Groups "Flex
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/flex_india?hl=en.