No pre-processing of the note is necessary if you make the user's intent clear through the event you send.
Send a different event from the view when you're adding than from when you are editing. Have the mediator listen for those events and send a different notification based on the event that was dispatched from the view. Then, an EditCommand or AddCommand will be triggered based on the notification that was sent from the mediator.
The mediator does the translation of the user's intent into the notification that triggers correct logic.
* Called when mediator is registered.
override public function onRegister():void
// Set component event listeners
form.addEventListener( AppEvent.ADD_THIS, handleAppEvent );
form.addEventListener( AppEvent.ADD_THAT, handleAppEvent );
form.addEventListener( AppEvent.EDIT_THIS, handleAppEvent );
form.addEventListener( AppEvent.EDIT_THAT, handleAppEvent );
form.addEventListener( AppEvent.DELETE_THIS, handleAppEvent );
form.addEventListener( AppEvent.DELETE_THAT, handleAppEvent );
* Handle AppEvents from the view component.
private function handleAppEvent( event:AppEvent ):void
switch ( event.type )
sendNotification( AppConstants.ADD_THIS, event.data );
sendNotification( AppConstants.ADD_THAT, event.data );
sendNotification( AppConstants.EDIT_THIS, event.data );
sendNotification( AppConstants.EDIT_THAT, event.data );
// Sometimes multiple events need to trigger the same command...
sendNotification( AppConstants.DELETE_ITEM, event.data );