The best practice guide (Page 13, Notification vs Events) shows that Notifications should be used to communicate between PureMVC actors Mediators, Commands and Proxies.
Yes this is also what i think so i've resolved this issue using the new event system of gwt 1.6 that make possible to define and fire custom event from view that are cached from the mediators:
ex:
public FriendshipsPageMediator() {
super(NAME,null);
....
proposeFriendshipView = new ProposeFriendshipView();
proposeFriendshipView.addNotificationHandler(this);
....
}
@Override
public INotificationType<?>[] listNotificationInterests() {
return new INotificationType[]{
NotifiesUserConfiguration.LOADED_USER_PROFILE,
NotifiesFriendshipsModule._PROPOSED_FRIENDSHIP,
NotifiesFriendshipsModule._EDIT_FRIENDSHIP
};
}
@Override
public void handleNotification(INotification<?> notification) {
....
}
@Override
public void onNotificationEvent(NotificationEvent<?> event) {
if (event.is(NotifiesUserSearch.LOAD_USER_PUBLIC_PROFILE))
showProfileOf(event.as(NotifiesUserSearch.LOAD_USER_PUBLIC_PROFILE).body());
}
in the code above when the mediator instantiate it's view component register itself as a listener of NotificationEvents of the view.
so when the view fire a NotificationEvent its onNotificationEvent gets called,
now the mediator can decide if manage localli this events of send an application level Notification build from the NotificationEvent