Title: Nested Mediator Typing Post by: dbasch on January 14, 2009, 12:01:15 Hello all,
I am trying to figure out the best way to handle the grouping of mediators. For example, let's assume that we have a library with books, book chapters and book pages.
It seems that the only way to ensure that notifications are sent to the proper PageMediator is to have a naming schema established. Something like this: "BookMediator_AtlasShrugged_ChapterMediator_1_PageMediator_1" However, this requires that the name of any "parent" mediators be available to PageMediator when it is instantiated. I must be missing something here. As an example, let's step through an "Add Page" command followed by a "Set Page Font" command with some psuedocode.
What techniques is everyone using to deal with this sort of issue? Should I add the grouping information to the Value Objects? Should I be trying to retrieve the grouping info from a Proxy? Thanks, Derek Basch Title: Re: Nested Mediator Typing Post by: puremvc on January 16, 2009, 07:18:23 In this situation, you'd want to derive the mediator names from the unique fields of the VOs you are working with. If mediators are created for every page you touch, then:
facade.registerMediator(new PageMediator("Library_"+ Title: Re: Nested Mediator Typing Post by: dbasch on January 16, 2009, 09:56:55 In this situation, you'd want to derive the mediator names from the unique fields of the VOs you are working with. Thanks Cliff, I am happy that I was on the right track. I think I am going to end up with some ridiculously long winded mediator names ;D Cheers, Derek |