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: Mediator that does not extend Mediator  (Read 7190 times)
jbtellez
Newbie
*
Posts: 1


View Profile Email
« on: December 14, 2007, 02:32:27 »

I am porting a Flash project over to PureMVC. The project is a 'Memory' type game where the task is to match tiles in a grid.  Each Tile class really is a Mediator to a movie clip so I was inclined to set it up like the mediators in the sample PureMVC code. But I actually want Tile to inherit from a custom class rather than Mediator. After viewing the Framework source, it looks straight forward enough just have Tile implement IMediator.  But I was curious to see if there was a deeper reason to always extend Mediator that I wasn't noticing.

Thanks for the great project, PureMVC is now my homepage! ;D
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: December 14, 2007, 03:44:38 »

Typically we want the view component to be seperate from its Mediator.The Mediator listens to the view component (the tile) for events (clicking perhaps) and responds by sending notifications or manipulating Proxies typically. It also listens for Notifications from the rest of the system, and responds by manipulating or passing data to its view component (tile.flip() perhaps.

The tile exposes an api to the Mediator for interaction. Methods, vars, events.

-=Cliff>
Logged
Pages: [1]
Print