PureMVC - Copyright(c) 2006-08 Futurescale, Inc., Some rights reserved. -------------------------------------------------------------------------- Release Date: 08/14/08 Platform: ActionScript 3 (Flash, Flex, AIR) Version: 2 Revision: 0 Minor: 4 Author: Cliff Hall License: Creative Commons Attribution 3.0 United States License -------------------------------------------------------------------------- 2.0.4 Dissallowed re-registration of Mediators in View.registerMediator. For more on this bug, see: http://forums.puremvc.org/index.php?topic=372 Modified View.notifyObservers to notify from a copy of the observer list rather than the actual observer list, which may change during the notification loop. For more on this bug, see: http://forums.puremvc.org/index.php?topic=490 2.0.3 Added notifyObservers back to IFacade, where it is required if you are sending custom Notifications. No unit tests required. 2.0.2 Refactored View.removeMediator method, moving the logic for removing an observer into a removeObserver method (also on IView), which is now called by the Controller.removeCommand method as well as the View.removeMediator method. This fixes the issue described here: http://forums.puremvc.org/index.php?topic=308.0 Also, the Proxy.removeProxy method only attempts to remove the Proxy if it is registered. 2.0.1 This is the public release, due to the limited release of 2.0 which did not contain onRegister and onRemove for Proxy and IProxy. Also Model, View and Controller classes have been moved together in the core package. This has impact to you only if you are extending or importing Model, View or Controller directly. Since access to these actors is generally through the Facade, this should not be an issue. 2.0 This release breaks backward compatibility with any previous release because the package structure has changed to incorporate the language for this release. Also, the Mediator naming scheme changed to match that of the Proxy. Now the constructor to the Mediator takes a mediatorName argument before the viewComponent argument. This means that you no longer need to override the getMediatorName method in your Mediators, you merely send the name to super to be set in the constructor.The Mediator also gets a setViewComponent method so that transient view components are supported. The Model, View and Facade removeProxy and removeMediator methods now return a reference to the Proxy or Mediator that was removed from the Model or the View. This supports dynamic unregistration and reregistration of Proxies and Mediators. And the Facade now implements INotifier, adding a sendNotification method. This method makes use of the facade's notifyObservers method, and so Notifier's sendNotification method now calls facade.sendNotification. This means that you never have to create a notification inside the facade and call notifyObservers, you may simply call sendNotification with the parameters in the same way that Commands, Mediators and Proxies do. It is left public in the facade only so that you may still create and send custom notification classes. Model and Facade get hasProxy method; View and Facade get a hasMediator method to. Mediator and Proxy get onRegister and onRemove methods. Notification.toString method was fixed. 1.7.1 A unneeded break statement was in the view's removeMediator method after the refactor for 1.7. This bug was not flushed out because of a flaw in the test which has been corrected. Here is the associated forum post: http://forums.puremvc.org/index.php?topic=181.msg579#msg579 1.7 The Controller's registerCommand method was modified to only create the corresponding Observer for the ICommand being registered if no previous ICommand was registered to the Notification name in question. The behavior of the method is the same in that if an ICommand was previously registered for the Notification, it is no longer used and the newly registered ICommand is. However, the previous implementation created and registered an extra Observer, which could lead to the new ICommand being executed twice. Added removeCommand method to the Facade, which is passed through to the Controller. Being such a little-used method its omission was intentional, but it is included now as a matter of form. Added to the removeCommand to the IFacade interface as well. An issue with the View's removeMediator method was fixed. The previous implementation iterated through the observer list, removing associated Observers, however this caused the length of the Observer list to change, leading to the possibility that some Observers would not be removed when they should have been. The issue is discussed here: http://forums.puremvc.org/index.php?topic=145.msg478#msg478 1.6 The 1.5 removeMediator implementation created a new situation where after an observerMap array was nulled due to its length falling to zero. subsequent calls to removeMediator could throw an exception. This was because the method of removing the only reference to the array was setting the observerMap value to null for the observerMap key in question. This method was used since Adobe's 'Programming ActionScript 3.0 > Core ActionScript 3.0 Data Types and Classes > Working with Arrays' says: "You may come across code that uses the delete operator on an array element. The delete operator sets the value of an array element to undefined, but it does not remove the element from the array". However, this proves to no longer be the case. So now, the delete operator is used to remove both observerMap and mediatorMap entries. 1.5 Amended removeMediator method to remove associated Observer references from the observerMap. When a notificationName's observer list length falls to zero the reference to the observer list is also removed. Added compareNotifyContext method to the Observer class and IObserver interface, which compares a given object to the Observer's notification context and returns a Boolean indicating their equality. This allows the View to compare the Mediator being removed with the Observer's notification context without breaking the Observer's encapsulation. 1.4 Added INotifier interface and Notifier class. MacroCommand, Command, Mediator and Proxy all extend Notifier and implement INotifier. The sendNotification method in Proxy and Mediator was moved to Notifier and is now available to Commands. Also the protected facade property was moved from Proxy and Mediator into Notifier, so Commands now get the facade reference at construction time. 1.3 Obviated the need for AbstractProxy and AbstractMediator in applications: * Implemented sendNotification convenience method in Proxy and Mediator * Added protected facade:Ifacade property initialized to Facade.getInstance() on both Mediator and Proxy. The concrete Facade must be instantiated first, but this call will return the concrete instance, even though the framework Facade.getInstance is called. 1.2 - Removed old files that were inadvertently included. 1.1 - Repackaged zip and updated inline docs