Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Show Posts

* | |

  Show Posts
Pages: [1]
1  PureMVC Manifold / MultiCore Version / Re: Help!ApplicationFacade getInstance return null. on: November 17, 2009, 06:48:09
Hello Cliff and thanks for your answer.

The error is the same as sigismund. The applicationFacade.getInstance return null, but when I run into the getInstance method with the debugger, the instanceMap[key] variable is defined as ch.fasa.modules.services.ApplicationFacade (@1b96cc11).

I noticed some mistakes with debugger...

I load Presentation module first time, module has the memory address "abcd".

I load Services module first time (Presentation module is unloaded), module has the memory address "efgh".

I load Presentation module second time (Services module is unloaded), module has the memory address "ijkl". The instanceMap doesn't contains any "Presentation" key, so it recreate it.

I load Services module second time (Presentation module is unloaded), module has the same memory address as the first time ("efgh"). Services module isn't unloaded from instanceMap and memory. The instanceMap contains already the module and take it to display it.

The think I don't understand is all modules uses the same "Shell", and it's the Shell who load / unload modules... So all modules use the same process to be loaded / unloaded, but only Presentation module is successfully removed from instanceMap and memory...

And... sometimes I'm a stupid animal... Copy and paste is the hell of developer... Each module has it's own "Dispose" command... and I have changed all things into each command, except the "RemoveCore" directive... All dispose command had removeCore( Presentation.NAME )... I changed the directive correctly (Services = removeCore( Services.NAME ), Products = removeCore( Products.NAME ), etc...) and all is ok now

Sorry for the disturbance  ::)
2  PureMVC Manifold / MultiCore Version / Re: Help!ApplicationFacade getInstance return null. on: November 15, 2009, 08:56:07
Hello,

Sigismund, can you explain how do you resolve your first problem ?? I have the same problem, the casting return null to me...

For more explanation :

I have a "shell" application who load some modules. It's a flash website with some sub-content. Each sub-content is a "module" casted as IModule into the shell. Sub-contents are "presentation", "services", "products", etc...

Actually I have only 2 sub-modules with basic implementation to test the loading. I load "presentation" first time, it's ok. After that select the "products" menu. Application unload "presentation" module (first removeChild, and next remove core). I load "services" first time, all is ok too.
Now I already select "presentation", the module is re-loaded successfully. I select a second time "services", and it return the error about the null facade instance... I don't understand why, because presentation is loaded correctly.

Any suggestion is welcome.

Thanks in advance :-)
3  Announcements and General Discussion / Getting Started / unit testing, how to start on: May 23, 2008, 06:33:35
Hello forum !!

I use PureMVC since last year, and be very happy with this architecture. Now in my current project, my customer want to add unit testing into the application. I have read about unit tests (I'm a newbie in unit tests), made some tests with a simple project and flexunit. Now, I would like to integrate unit testing into my pureMVC application, and really don't see how to start with it...

First, which unit testing framework to use... Flexunit, ASunit, Funit ??

Second, how to integrate unit tests into a big application ?? To test only piece of code in a function, it's not really a problem... but to test cyclic processes like :

1. component dispatch an event
2. mediator handle event and send notification to execute command
3. command execute it process and send an alert notification
4. mediator(s) handle the alert notification to know that the command was correctly executed

Must I integrate the testRunner into the application itself ? because if I want to use the whole process, Application, mediators, views, models, commands must be instanciate... I can't create a new project and instanciate only the mediator or the command I would like to test because there is a lot of dependencies on facade, notifier, etc...

Is there some samples about ? I searched for several hours and don't find any, even minimal, tutorial, sample or documentation :-(

Any code snippets or way to follow would be appreciated. Thanks a lot in advance (and sorry for my english).

Pages: [1]