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 / General Discussion / Re: mediator for notification processing. no view. on: January 17, 2011, 10:19:10
thanks cliff, allowing the mediator a bit more logic than usual when it's not tending a view component is the confirmation i was looking for.  instinctively it seemed legit but i couldn't formalize a justification, so thanks.
2  Announcements and General Discussion / General Discussion / mediator for notification processing. no view. on: January 06, 2011, 04:55:47
is it bad practice to use a Mediator purely for processing Notifications (and sending out new Notifications accordingly), where the Mediator has no view component?

the specific scenario that's given rise to this question:

DownloadProxy sends Notifications; complete, progress, error, cancelled, etc.  the app needs to react to these Notifications in various ways.

i could create separate Command classes to process each of these different Notifications, but that seems excessive.  instead, i'm thinking of creating a Mediator that is interested in all of those Notifications, processes them, and sends out reactive Notifications.  it keeps everything grouped in one spot and all of that behaviour is related so i don't see a need to modularize it all out into separate Commands.

anything wrong with this approach? 
3  Announcements and General Discussion / General Discussion / Re: flex 4 and ApplicationMediator on: January 06, 2011, 04:26:53
i never replied to this and i should have.

thanks cliff for the response, indeed i needed to wait until after applicationComplete before doing all of my mediator instantiation.  why i was triggering on added_to_stage i don't really know, i think it was just very old code that i wrote when i was just learning puremvc.
4  Announcements and General Discussion / General Discussion / flex 4 and ApplicationMediator on: December 03, 2010, 06:28:00
i'm switching from flex 3 to flex 4 and i'm hitting a few snags.

i create all my mediators in ApplicationMediator.  in flex 3, i listened for the ADDED_TO_STAGE event in ApplicationMediator to get references to all the instantiated views in the app.  now in flex 4, i get null references on a lot of the views within that added_to_stage event.

i'm probably missing something very basic here, but haven't been able to figure it out.  what event should i be listening to with ApplicationMediator to ensure that all of my views in the app are instantiated?
5  Announcements and General Discussion / General Discussion / Re: communication between application instances via FMS on: March 05, 2009, 12:10:38
thanks again cliff.

can you clear this up for me?  a Message (implementing IPipeMessage) has a few more attributes than a Notificiation, and the body in both is an object, so i'm just not seeing how an IPipeMessage is more versatile / strongly typed than a Notification. 

I just don't see how using an IPipeMessage will help me avoid marshalling/unmarshalling the body payload compared to a Notification.  and i really still can't see how i could send an IPipeMessage across the line more easily. 

can you give me a simple example?  i'm sorry i'm being so thick on this.  i've read joshua orstrom's little tutorial on understanding pipes, and i get the overall structure, but even in his example he's doing marshalling /unmarshalling of messages to notifications between the modules and the application.

6  Announcements and General Discussion / General Discussion / Re: communication between application instances via FMS on: March 04, 2009, 10:57:26
thanks for the response cliff, i really appreciate it.

i've been reading about pipes utility, and conceptually i understand it within the multicore context.  at an abstract level, it makes sense to me to treat different application instances as modules, but in practice i don't know where to begin with it.

i will have application instances running on different computers, but will want to synchronize their states in part, or in whole.  it's not clear to me how or if i could easily establish VM to VM communication with pipes over a network - i do use Flash Media Server so i figure that will be the delivery method, but can't quite see yet how that would be accomplished with Pipes.

what i envision is that the execution of a Command would occur in one VM (triggered by a Notification), and then dispatch that Notification over the network to other subscribed VMs, and then those VMs would trigger execution of the same Command as though it were triggered within their own VM.  i suppose it would be some sort of application mirror.

what i'm trying to avoid is writing code for each Notification to serialize and deserialize/demux it to send/receive across the network to another VM.  i'd like to send a Notification out to inject into another identical VM and have that VM treat the Notification as though it were issued by itself.

the IPipeMessage (defined in the pipes utility) would be a better bet. Its far more versatle, and doesn't make any assumptions about the recipient in terms of having the same notification names defined for the same purposes.

you've suggested using an IPipeMessage as the message currency, but i'm okay with the recipient (another application instance) making assumptions about identical notification names for the same purposes, since i'm just trying to synchronize multiple application instances.  should i still consider using an IPipeMessage? how could i establish a Pipe across a network to an app instance running on another computer (via Flash Media Server)?

i'm sorry if it sounds like i've just repeated my first question, but i felt like i didn't describe it well enough.  any further ideas would be greatly appreciated.

7  Announcements and General Discussion / General Discussion / communication between application instances via FMS on: March 02, 2009, 09:22:35
i've got a multiuser interface that communicates via FMS. would it be possible to serialize notifications and broadcast them to other application instances, via Flash Media Server? i want to avoid a lot of building classes to translate what comes in from FMS, and just pass the message along.

thanks for the help so far
8  Announcements and General Discussion / Architecture / saving and reloading application state on: February 24, 2009, 08:29:55
i'm using the Undo utility with PureMVC and it seems like i can use the Command stack in the CommandHistoryProxy to implement persistent application state.

i'm building a media viewing/editing application, it will be heavy on UI components.  lots of windows and buttons and options.  i would like to take a snapshot of the overall application state, store it, and use it to replicate that state at a later time.  (stored to a database most likely).

what i'm thinking so far is that to take that snapshot, i can simply look at the Command stack, and serialize each individual command out to a database, and later read them in, in order, reconstruct them and execute them to rebuild the application state.

am i taking the right approach? it seems i would have to write a serialize/deserialize function for each Command, or perhaps use a CommandFactory that builds these Command instances.

i'm just wondering if i'm on the right track here, or if there's some other part of PureMVC that i should be looking at.

thanks for your time
9  Announcements and General Discussion / Architecture / ViewComponent registry on: February 20, 2009, 11:32:01
i'm new to pureMVC, so tell me if i'm going in the completely wrong direction.

i'm wondering if i need a ViewComponent registry, similar to the registries for mediators and proxies.

i have a custom view component, MediaPlaybackUI. i create them dynamically at runtime, there can be multiple instance.  i do the construction of MediaPlaybackUI in a Command, then send a Notification of this new instance.

elsewhere, a Mediator is listening for this notification.  the Mediator has a reference to a class i've called MediaDisplayUIsLayoutManager, which deals with the visual layout of all the MediaPlaybackUI instances. 

should i store the MediaPlaybackUI instance in a view component registry, and then retrieve it when the notification of the new instance gets to the Mediator?  or should i pass a reference the new MediaPlaybackUI instance inside the body of the Notification?

if a ViewComponent registry is the right way to go, should i add registerView/removeView/retrieveView  to ApplicationFacade, and cast facade to ApplicationFacade each time i need to access the view component registry?

thanks for the help
Pages: [1]