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  Announcements and General Discussion / Architecture / Single Proxy - Multiple Delegates? on: February 11, 2010, 10:52:20

Hi -

I'm planning to use a single proxy that can be used to invoke one of several different delegates. The single proxy will employ a value object that acts as the schema for data supplied from various delegates. Thus, a single notification will request some data by providing a type value and the proxy will choose the appropriate delegate based on that value. The requesting application will then receive more or less the same data without having to worry about how it was acquired.

Does this sound right? Are there drawbacks to this approach? Is there another best-practice approach? Thanks.

Peter
2  Announcements and General Discussion / General Discussion / unlist notification interest in mediator? on: March 05, 2009, 01:34:27
Is there a best practice way to remove a notification interest from a mediator? I'm using a flag in handleNotification at the moment... LAME! Got to be a better way than this? :( Thanks!

Peter
3  Announcements and General Discussion / Architecture / AS only and Multicore : problems w/ ModuleBase on: January 16, 2009, 08:59:17
I'm looking at whether to try to use the multicore version for my AS3 only project. So far I've successfully created a module with ModuleBase. This gives me the ability to optimize linking for the containing application and best of all I get the little blue icon in FlexBuilder. Sweet! (Strangely the compiler initially places the .swf in the class directory rather than the Output directory, but then it started updating on compile once I moved it. A bit confused about this.)

Unfortunately, there is very little documentation for non-Flex framework modules, but I would like to try to make it work with multicore. My first problem is that ModuleBase does not apparently extend a DisplayObject class and so I was unsuccessful in trying to add my module to the stage. I tried to cast the module but no luck. Anyone know what I'm doing wrong with that? I thought .swfs were intrinsically display objects?

Anyways, as a work around I've winded up making the ModuleBase derived class a display object factory of sorts and pass the objects to my main application to be added to the stage when appropriate. This gives me the benefit of smaller downloads, but leaves something to be desired on the application scalability side.

At this point I'm thinking of abandoning multicore to just use a single core that loads modules that are simply view libraries, but of course this does not give me the benefit of scaling my control logic with multicore. Another idea is to have the ModuleBase derived class create an application runner class that extends Sprite and in turn sets the facade instance as normal. I think this probably makes the most sense if I can make it work?

On this last point - it seems like it would be practical for modules to have a way to send notifications via their own facades and the parent facade. Not sure if this makes sense. Perhaps this should be avoided as it breaks encapsulation? Thanks.

Peter

4  Announcements and General Discussion / Architecture / Dom Level 3 in Commands - listen to components that use Flash event model? on: January 01, 2009, 09:11:28
Hi -

Not exactly sure if this is the problem. It's only a hunch at this point, but here are the clues and context.

I need to use a third party component in my application and I have no access to the source code. The component makes requests to an ad server and returns xml. The basic API for the component is to instantiate the component, call methods on it and listen for callbacks. The listeners are created IEventDispatcher style so I'm assuming the component to be a Sprite or some kind of displayObject.

I am currently refactoring my app from a basic Sprite based design over to Pure MVC. In the earlier version I instantiated the ad component object and did not need to add it to the stage to handle the xml load event. However, it was hosted in a Sprite that existed within the Flash dom. It works fine this way.

In my new Pure MVC based version I am trying to house this logic in a command called LoadAdCommand. This command listens for the ad response and I was intending to either update a model object via proxy or simply send a notification containing the ad xml back to the mediator to execute further ad display logic.

At present the xml loaded event is not firing in my command, however I can see the response coming back correctly in Firebug.

Anyone have any ideas? Thanks!

Peter
5  Announcements and General Discussion / Architecture / invoking AsyncMacroCommand w/ "body" display Obj argument? on: December 26, 2008, 11:01:27
I would like to pass a reference to the stage via the body argument in my extended AsyncMacroCommand as is done with simple commands. But the pattern doesn't seem to allow for this as initializeAsyncMacroCommand() is called from the constructor with no arguments.

I'd like one of my subcommands to contain a stage reference so that I can access the Flashvars collection via LoaderInfo.parameters. I'm passing some values with Flashvars and some via xml configuration files.

I'm thinking my best option will be to pass a ref to the display object in my AsyncMacroCommand derived class constructor where I will also call super to initialize the command array and invoke initializeAsyncMacroCommand. Does this sound reasonable? Is there a better way to do this? Perhaps I'm missing the point of this utility and so no body object arg should be required? Thanks.

Peter
6  Announcements and General Discussion / Architecture / Modularity - Why Shell and Canvas? on: December 17, 2008, 08:29:27
Hi -

I'm interested in using the multicore version for my AS3 only app. It looks like I can use the ModuleBase class without the overhead of Flex framework required by Module - barring this I will simply load a swf.

I've been pouring over the Modularity example and I can't quite work out why I should need both a shell and the canvas? It seems to me like there is some redundancy here and so I'm wondering what potential scaling scenario I am missing?

This seems further complicated by the Shell consisting of both a view and a mediator. I'm inclined to start with just one mediator(shell) and one view(canvas) and then refactoring when the need arises. Anyone have any thoughts on this? Thanks.

Peter
7  Announcements and General Discussion / Architecture / PureMVC proxy/model singleton vs. Cairngorm ModelLocator? on: October 03, 2008, 02:25:02
Hello -

I am interested in building a project with Pure MVC. I have built several projects with Cairngorm which I find to be architecturally similar in some respects. My question pertains to the general strategy for the data model in PureMVC.

In Cairngorm I have been using the ModelLocator singleton as a composite for the application model. As such I find this practice helpful as it is declarative and provides a centralized overview of the application domain model.

In contrast the Pure MVC framework does not appear to have a single model singleton defining model data. Instead the model singleton allows for proxy objects to be registered via the facade. Are there any best practices regarding the structure and registering of model logic? The examples provided are small and do not address a strategy for scaling application model logic.

How, for example, would I store and access something like application configuration data in Pure MVC? In the RSS reader sample a FeedVO is utilized. Suppose I wanted to cache a collection of these on the client for a history feature. Where would these go?  Can anyone share/shed light on this subject? Thanks!

Peter
Pages: [1]