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

Pages: [1]
Print
Author Topic: Which object implements IPipeAware?  (Read 14270 times)
jlahr
Jr. Member
**
Posts: 19


View Profile Email
« 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?

Thanks.
Logged
jlahr
Jr. Member
**
Posts: 19


View Profile Email
« Reply #1 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?
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #2 on: March 23, 2010, 11:26:04 »

A Flex Module should implement IPipeAware. Or the loaded swf if you're using Flash so that would be the Document class. Not the Facade.

-=Cliff>
Logged
jlahr
Jr. Member
**
Posts: 19


View Profile Email
« Reply #3 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.
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #4 on: March 26, 2010, 01:49:51 »

The StageMediator probably shouldn't be the plumber here. I'd do that with a Command probably. The StageMediator wants to see this as a Sprite or something visual.

-=Cliff>
Logged
Elephant
Newbie
*
Posts: 9


View Profile Email
« Reply #5 on: February 11, 2011, 10:37:49 »

Cliff,

Could you comment on why you find it preferable to implement IPipeAware in the Module class rather than in the Facade?
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #6 on: February 12, 2011, 10:59:13 »

Because you don't want to expose the Facade itself. That is internal to the core/module. You don't want to retrieve a facade from another core and take actions on it. By implementing an IPipeAware interface at the module level, are able to poke the pipes into it and send it messages without breaking the encapsulation of the module itself.

-=Cliff>
Logged
Pages: [1]
Print