Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

6. Mediating the View > Building the Mediators

Building the Mediators

In StoryArchitect, we make use of the view hierarchy itself to pass down a shared SelectionContext and to bubble events up from the deepest subcomponents. Thus we do not really need much mediation. We are going to use some pop ups to get things done as well, but we will talk about how we handle them in Chapter 9.

So far, we are sure that we need these three Mediator subclasses:

  • ApplicationMediator

  • ChooserMediator

  • EditorMediator

In our case, there is no common functionality we need to share between these Mediator subclasses, so there is no need to create an AbstractMediator as we did with AbstractProxy. All these classes will extend Mediator and override or add the methods necessary to communicate with their View Components and the rest of the system. In the following implementations, note how every View Component does not necessarily dispatch (or bubble through) events that the Mediator needs to handle. Similarly, some Mediators have no Notification interests. The balance of Event and Notification handling responsibilities is different for every Mediator/View Component pair, but usually includes some of both. It just so happens that these particular Mediators ended up doing one or the other.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial