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

Show Posts

* | |

  Show Posts
Pages: [1]
1  PureMVC Manifold / Port Authority / Re: Command Registration questions on: December 14, 2007, 04:25:32
Since the documentation states that the command registered last should be the one used, we propose a different implementation which in our Java port currently looks like this:

   public void registerCommand( String notificationName, Class commandClassRef )
   {
      if (null != this.commandMap.put( notificationName, commandClassRef )) return;
      this.view.registerObserver( notificationName, new Observer( new IFunction()
      {
         public void onNotification( INotification notification )
         {
            executeCommand( notification );
         }
      }, this ) );
   }


We replace the command if one was registered before, but do not add another observer. Okay with you?
Pages: [1]