Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Welcome, Guest. Please login or register.
December 18, 2017, 07:47:46 AM
Home Help Search Login Register
News: Please DM @puremvc on Twitter to gain forum access. Spambots are why we can't have nice things.
Pages: [1]
Print
Author Topic: Which object implements IPipeAware?  (Read 6398 times)
jlahr
Jr. Member
**
Posts: 19


View Profile
« on: March 23, 2010, 07:16:02 AM »

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
« Reply #1 on: March 23, 2010, 07:25:41 AM »

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
« Reply #2 on: March 23, 2010, 11:26:04 AM »

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
« Reply #3 on: March 23, 2010, 05:49:41 PM »

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
« Reply #4 on: March 26, 2010, 01:49:51 PM »

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
« Reply #5 on: February 11, 2011, 10:37:49 AM »

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
« Reply #6 on: February 12, 2011, 10:59:13 AM »

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
Jump to: