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] 2
1  PureMVC Manifold / MultiCore Version / Re: Which object implements IPipeAware? on: March 23, 2010, 05:49:41
Thanks, Cliff, this makes sense.

My only problem now is that I'm loading these SWF's in via a LoadSwfCommand in my Shell. This command generates a Loader based on url and then sends that off to the StageMediator with an ADD_TO_STAGE noftification.

What I'm having trouble doing is getting the StageMediator to cast the Loader as IPipeAware so that it can setup the pipes.

Is there a better way to do this?

I was thinking, based on a previous post, that maybe giving my SWF it's own SwfMediator which listens for ADDED_TO_STAGE and tries to case it to IPipeAware then, but I haven't seen anybody doing that in the examples so far.

Thanks again.
2  PureMVC Manifold / MultiCore Version / Re: Which object implements IPipeAware? on: March 23, 2010, 07:25:41
I should mention that I'm working in a pure Flash/AS3.

I also see where it's common in Flex apps to create an IPipeAwareModule and extend that. Not sure if that's preferable to directly implementing IPipeAware or not. Thoughts?
3  PureMVC Manifold / MultiCore Version / Which object implements IPipeAware? on: March 23, 2010, 07:16:02
I've seen it in the top-level Document class, the Facade and sometimes not at all.

Where's the best place to implement IPipeAware?

4  Announcements and General Discussion / Getting Started / Re: Adding and removing view components from stage... tangle of concepts. on: January 25, 2010, 03:20:53
Thanks Cliff, this is helpful.

Using your suggestions I set up a StageMediator whose sole responsibility is to load and remove SWFs. Then I put up a few navigation buttons to allow me to load those swfs. I gave the buttons a mediator which listens for button clicks and sends an ADD_TO_STAGE notification to the StageMediator along with the SWF loader corresponding to the proper button.

Now, I'm worried I've giving too much responsibility to the button mediator. For example, if I wanted to load a SWF from anywhere else in the application, it doesn't make sense, to me, to have to handle it through a button mediator which really should do nothing but listen for clicks.

Does moving this logic into a Command make sense? I've always thought of a command as a discrete chunk of procedural code and I don't see how it would function as, what seems to me, a mediator for the StageMediator. I.e. button tells command to load 'Home', command packages this and sends out the ADD_TO_STAGE notification? Why not just cut out the command and have everything talk to the StageMediator directly?

Also, if I want the loaded Swf to initiate an ADD_TO_STAGE notification is it as simple as importing that top-level StageMediator and sending the notification?

Thanks for your help.
5  Announcements and General Discussion / Getting Started / Adding and removing view components from stage... tangle of concepts. on: January 20, 2010, 09:45:04
I'm taking a step back from the project I'm working on and trying to relearn the principles behind view components. I've read several posts that address concrete mediator / view component coupling and have read the best practices document half a dozen times, but it still doesn't click.

My issue is that I don't understand who is ultimately responsible for adding or removing a viewcomponent from the stage. By extension, I don't understand how entire sets of components (complex interfaces, for example) are managed and, to take it up one more level of abstraction, what that means for multi-swf projects.

Imagine a user signup process. The user goes through several screens containing forms and, upon completion, is dropped into the 'home page' which is a new swf. How do I break this down? Each page is a seperate view component? Global mediator handles the transition between page components? Upon completion, some kind of super global mediator drops the whole user signup swf and then loads the home swf?

I think my confusion is falling in these areas:

- Should the overall view hierarchy be managed in one mediator? I imaging if we're loading and removing entire panels there needs to be some parent to handle that transition. But which actor is actually processing the 'addChild' & 'removeChild' commands? Are we adding child directly to stage or to GlobalView?

- Mediators are allowed to add their own components. But don't mediators expect 1 argument for it's viewComponent? Do I just drop that param and create the viewComponent myself in the constructor?

- Ok, so even if we have mediators creating their own components, where do we instantiate the mediators? I know the initial set of mediators are created in the StartupCommand? Does it then follow that any new set of mediator / view component pairs be created in a command?

- How does this tie into a multicore paradigm with several swfs? I feel like this would require several sets of generic stage handlers, each handling the adding and removing of view component / mediator pairs according to their level of abstraction. I.e. GlobalSwfMediator which loads swfs which each have their own StageMediator which loads view components which each have their concrete mediator which add subcomponents... and so on down the line.

There are just some of the basic issues I'm not clear on. I understand the principles of view encapsulation and notifications and separation of data model from business logic... etc. There's a chasm, however, between these design concepts and practical implementation.

That's for your patience, I know this is waay too wordy. I just want to distill the above tangle of concepts and responsibilities into a few key techniques and I feel like a lot of people go through this stage with the famework.

Thanks for your help!
6  PureMVC Manifold / MultiCore Version / Re: Notifications in multicore? on: January 07, 2010, 09:02:12
Thanks Philip.

I had a similar idea about similar to Justin's broadcast function which would pass notifications between modules.

Obviously Cliff defends the use of Pipes because when you have independent modules/teams you have less control what notification names people use.

Personally I want to avoid Pipes because I think the strict modularity it provides is overkill for the scope of the project and I don't have enough time budgeted to fully implement and understand it.

Good information though...
7  PureMVC Manifold / MultiCore Version / Re: Notifications in multicore? on: January 06, 2010, 02:07:08
Proxies send notifications. But notifications can't be broadcasts across cores...

So the Proxy sends a notification to an interested mediator in its own core which in turn controls a mediator in a different core via the second mediator's interface methods?
8  PureMVC Manifold / MultiCore Version / Re: Notifications in multicore? on: January 06, 2010, 12:14:45
Thanks Mariush,

Is there an alternative that doesn't rely on Pipes or interfaces?

In regards to Pipes:

This is my first PureMVC project and it's been difficult enough getting multicore set up properly. Pipes sounds really cool but I'd like to avoid the added complexity until maybe the next project.

In regards to interfaces:

I see that you can write an interface in one core that can be accessed by another core. But, to me, that seems like strong coupling.

To use the above example, I feel that if LoginProxy were to interact with CoreB's mediator by calling CoreBMediator.loginSuccessfull(true) would mean that LoginProxy would have to know about CoreB's mediator or any other interested mediator elsewhere.

There must be a misunderstanding I'm having here but I keep looking at Modularity for answers and it's just hasn't clicked yet.

Thanks again!
9  PureMVC Manifold / MultiCore Version / Notifications in multicore? on: January 06, 2010, 10:55:38
Can notifications be sent between cores in MultiCore?

For example: LoginProxy in CoreA sends a notification LOGIN_SUCCESSFUL to a mediator in CoreB which in turn loads CoreC... etc.

10  PureMVC Manifold / MultiCore Version / Re: Page 'redirect' in Mediator or Command? on: January 04, 2010, 08:35:05
In this case, the View Component is solely responsible for loading SWFs according to user input and application state so it needs to listen to notifications coming from any number of cores. I figure it doesn't make sense to put notification handling in the View Component since that's what the mediator is good at. So I have a mediator that listens for any LOAD_X notifications and calls the the View Component's loadPage(X) method, which in turns loads a new SWF and a new core.

Even though my View Component relies too heavily on its mediator to tell it what to load, I feel like the component itself is a pretty reusable piece of code in that just loads whatever SWF the mediator passes it.

I'm still developing this so I can't say if it'll work or not. This is just my interpretation on how to implement a Shell core that will allow me to load SWFs on demand.

11  PureMVC Manifold / MultiCore Version / Re: Page 'redirect' in Mediator or Command? on: December 29, 2009, 03:46:19
I feel like a View Component would be a bad choice because, in my understanding, they are to have the least amount of logic of any component in the framework. They just package data and hand it of the Mediator.

I feel like a single mediator that did nothing but listen for redirect notifications and accessed the stage accordingly seems like the way to go.
12  PureMVC Manifold / MultiCore Version / Re: Page 'redirect' in Mediator or Command? on: December 29, 2009, 03:03:11
Thinking more about this, I'm tending towards handling this in a StageMediator (which I'm just now starting to see purpose of) because it's dealing with the entire stage as a View Component rather than just a subsection such as a LoginForm.

Even still, I'm not sure if the StageMediator should manage redirects over a Command.
13  PureMVC Manifold / MultiCore Version / Page 'redirect' in Mediator or Command? on: December 29, 2009, 02:44:40
If I have a LoginFormMediator that listens for a LOGIN_SUCESSFUL notification from a remote proxy, should I load the homepage.swf  in the LoginFormMediator's notificationHandler? Or, in the interest of code reuse, create a Redirect command that handles the loading of external SWFs and pass it whatever it needs?

Is this something the PureMVC has a philosophy on or am I starting to get too implementation-specific?

14  PureMVC Manifold / MultiCore Version / Simple Modularity 1.2 question... on: December 29, 2009, 08:41:46
I'm trying to understand the Modularity example to get my head around MultiCore.

Is org.puremvc.as3.multicore.demos.flex.modularity an example of a 'Shell' core?

15  Announcements and General Discussion / Getting Started / Multi-page Flash apps without MultiCore? on: December 23, 2009, 11:39:20
I'm working a Flash project with a half dozen or so different screens. My understanding based on posts in this forum is that any project that requires loading multiple SWFs is a good candidate for MultiCore.

Since I'm new to PureMVC in generally and want to avoid the added complexity of MultiCore, I'm curious if people have been able to implement complex, multi-page Flash movies without it. I'm assuming that if I can't load external SWFs without MultiCore the only other option is to store each page as it's own MovieClip and load them dynamically. If that's true, am I correct in assuming that these clips will all have to load when the app is open and there's no way to load a MovieClip on demand?

If anybody has solutions that have worked for them, I'd love to hear them.

Pages: [1] 2