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: Unable to retrieve registered Proxy on: June 09, 2008, 11:03:26
Thanks Cliff,

Respecting the registration order is tricky. If I do all my registrations from one main StartupCommand can I trust that once the last line is executed the system is fully initialized?

BTW: I also send a notification from my StartupCommand to initialize common components such as Header and Footer. So in my main module startupCommand I register subcomponents Startup Commands (HeaderStartup, FooterStartup) and then send the notification to execute them. Do they run in a separate thread? See example below:

:

//Mediator registration
...

//Proxy registration
var usProxy:IProxy = new UserProxy();
facade.registerProxy( usProxy );

/********************* Register Commands ****************************/
facade.registerCommand( Constants.FOOTER_STARTUP, FooterStartupCommand );
facade.registerCommand( Constants.HEADER_STARTUP, HeaderStartupCommand );
//Send the notifications for our children
sendNotification( Constants.FOOTER_STARTUP, module.footer );
sendNotification( Constants.HEADER_STARTUP, module.header );

//At this point can I send out a notification that the initialization is complete or is header and footer init in a separate  thread?

Thank you,

Greg
2  PureMVC Manifold / MultiCore Version / Re: Unable to retrieve registered Proxy on: June 06, 2008, 07:11:09
Thanks Cliff,

Sorry, should have seen that in the API docs.

If I now wait to perform my WS calls in onRegister, do I still need to be concerned with the order that I register my Mediators, Proxies and Commands? For example I was concerned that I should have my Mediator that listens for the 'PROXY_INITIALIZED' notification registered before the Proxy that sends the notification.

Much appreciated!

-Greg
3  PureMVC Manifold / MultiCore Version / Unable to retrieve registered Proxy on: June 05, 2008, 02:39:29
Hi Folks,

I am registering a Proxy that sends a notification in initializeNotifier() to inform the system that the proxy data model has been loaded (I am using a local test stub so it goes very fast). I have a registered Mediator (Registered before the Proxy in my StartupCommand) that listens for the proxies 'init_complete' notification. When the Mediator receives the notification it retrieves the proxy from the facade, but it is null. How can this be, it was registered, initializeNotifier was called...

In debugging I walk through the modules startup command and step over the registration of the proxy. The mediator has a breakpoint in handleNotification and it is triggered before register proxy returns as I step over. I 'think' my proxies multiton key had not been set before initializeNotifier was called (just a guess).

As an added note my proxy is a common proxy. Most of my modules need access to a common VO's so I have a common package with my common VO's proxies ect. I have modeled the multicore demo app and altered it to load/unload modules. This proxy was first loaded by the module shell and all was well. My first loaded module also needs this proxy and registers it to its own facade, but the second time this this problem occurs.

Any help much appreciated.

Thanks,

Greg

4  PureMVC Manifold / MultiCore Version / Re: loading modules dynamically on: June 04, 2008, 05:30:09
I had this error too. I modeled the multicore demo app and altered it to work with modules.

When I debugged it I found that the method I was using to generate the multiton key was doing:

return MODULE_URI+this.id;

In my case this.id was null. I updated my impl to:

return MODULE_URI+this;

And the issue was resolved.

It seemed that 'this' was providing a unique Id. To be honest not sure of the impact with multicore, but as far as a unique id I seem to have one.
5  PureMVC Manifold / MultiCore Version / Re: Proxy data not ready when UIComponents are created on: June 04, 2008, 05:20:36
Thanks Cliff,

I like it, once my base object model is loaded I will 'open the curtain'.

Cheers,

Greg
6  PureMVC Manifold / MultiCore Version / Re: Proxy data not ready when UIComponents are created on: June 04, 2008, 02:49:26
Thanks Cliff!

Interesting, I can do that :-). I am just now testing with a real ServerStub and have been using a LocalTestStub while I have been waiting for the server team to finish the web service endpoints. My local test stub was super fast and now am realizing I cant assume the data is ready on initializeNotifier().

The first service call I am integrating is just fetching the ServerConfig and it has a short response time. If I employ the strategy you reference it would be unlikely the EU would ever click on the 'About' link quick enough to see the blank fields.

Do you use this strategy most often? I does feel right due to the asynch nature of a HTTPService call. However, in many, and even this case, I feel my UIComponent should display some sort of progress indicator as I don't want to display an empty form (or worse throw an exception). My next call is fetching a server dir listing to populate a tree that wont be so fast... How do you handle UI dependancies on remote data? Would the proxy send a notification to say "I am loading this VO" then "I have the VO" and the Mediator would be interested in both and display some loading indicator using an alternate state of the component?

Much appreciated,

Greg

7  PureMVC Manifold / MultiCore Version / Proxy data not ready when UIComponents are created on: June 04, 2008, 01:14:41
Hi All,

New to ActionScript, pureMVC and multicore.

My application has a ServerConfigProxy responsible for caching and providing access to a ServerConfigVO. In my Proxies initializeNotifier() I initiate an HTTPService call via a remote stub class, once the result is ready I seed the proxies cache with the constructed ServerConfigVO.

Problem is the UI Mediator requests the ServerConfigVO before the Proxy has received it. How should I be handling this? Should I check if the VO is null, use a Proxy loading flag and display a progress meter, once the loading flag is false get the VO?

Any help much appreciated.

Thanks,

Greg
8  PureMVC Manifold / MultiCore Version / Re: How to register dynamic components (Popups) on: May 15, 2008, 01:42:23
Excellent, thank you.

-Greg
9  PureMVC Manifold / MultiCore Version / Re: How to register dynamic components (Popups) on: May 14, 2008, 10:19:23
Thanks Cliff, much appreciated, I missed that. Working now :-).

As far as my About.mxml and associated Mediator I chose to have a public member variable initialized in the parent component (Footer.mxml) so that I can register the Mediator in my StartupCommand by accessing footer.aboutWin to construct and register the AboutMediator. This seems ok for this module, however some of my more complex modules this would get quite ugly (drilling down several components deep) to access the UIComponent to build the Mediators. Should I be having my components register themselves? What is best practice, maybe my component design is overkill, but I like the reuse and encapsulation?

Cheers,

Greg
10  PureMVC Manifold / MultiCore Version / How to register dynamic components (Popups) on: May 13, 2008, 02:16:17
Hi Folks,

New to ActionScript, puremvc so please bare with me.

In registering my Mediators I need reference to the UIComponent for the constructor. I have a Footer component that has a few links; About, Terms of Use, Privacy policy ect... My Footer has a mediator to listen to the link clicks dispatched and perform the associated action such as display a TitleWindow as a pop up. My About component has some other links allowing the user to navigate to the EULA, and some external url's so I felt it was just to have an AboutMediator to listen to the components dispatched events and decouple the About window functionality from the footer. My StartupCommand responsible for registering the mediators does not have the ability get a reference to the About component by drilling down through parentComp.footer.aboutWin because it is only instantiated at runtime. I tried to just have a member variable in the Footer.mxml component instantiated to an instance of the About.mxml component so I can reference it when registering the AboutMediator. When I run the application I get the following error:

Error: multitonKey for this Notifier not yet initialized!
   at org.puremvc.as3.multicore.patterns.observer::Notifier/get facade()[C:\Documents and Settings\Owner\My Documents\workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\observer\Notifier.as:89]
   at com.corp.prod.common.view::AboutMediator()[C:\dev\eclipse\workspaces\corp\proj\src\com\axentra\hipserv\common\view\AboutMediator.as:25]
   at com.corp.prod.modules.landingPage.controller::StartupCommand/execute()[C:\dev\eclipse\workspaces\copr\proj\src\com\corp\prod\modules\landingPage\controller\StartupCommand.as:43]

I am using the multicore version as I am employing a modular design, hoping my issue is not related, if so I can provide more info.

Any help much appreciated.

-Greg
11  Announcements and General Discussion / General Discussion / Re: Project Directory structure on: February 07, 2008, 02:55:40
Thanks for your comments!

I didn't consider placing assets with the components, interesting strategy and see your point. Past projects I have worked on in java, I made great efforts to place style, layout and graphical assets away from the java classes and always avoided at all costs placing code in the jsp's. This was because I often had a graphics/web designer working on the same project and to avoid code corruption allowed them to work isolated from the actual logic. Graphics and web designers are familiar with xml markup, style sheets and graphics, but not the code and allowing them to perform their work without the confusion of negotiating with the code was very benefitial to both sides of the team. The project I am working on does have a graphics/web designer and for the reasons mentioned I may not employ this strategy. For these reasons I am also feeling a bit uncomfortable placing 'views' folders inside the source tree, however the close relationship with the mediators is convinsing me otherwise. However, being a new team, new employer new language/sdk I am not sure if the graphics/web designers will be comfortable editing view components directly. I am going to try and I guess will train them on only editing 'components' and assets folders. Have you had success with this in your projects?

My application is split up into multiple parts and will follow the strategy you referenced.

I also think it might be wise to create a separate main source in the project root folder 'src' to house the project source to avoid polution (metadata folders, build output, libs and htmltemplate).

Much appreciated!

Greg
12  Announcements and General Discussion / General Discussion / Project Directory structure on: February 06, 2008, 11:23:30
Hi All,

Getting ready to start my first project and am looking for guidance on the project directory structure.

Should the main source folder just be the root project dir?

Should this main source folder contain an assets, css, com, org ect.. or should I separate swf, css and image resources from the code?

From the training I like the package structure com.comp.app.model/view/controller.

Any examples are much appreciated.

Thanks,

Greg


Pages: [1]