Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

RC2 Release Notes

  • Automatic Swiz tear down - When the dispatcher for a Swiz instance is torn down, the Swiz instance itself will automatically be torn down as well, performing all necessary cleanup for the objects it manages. Practically speaking, this means that when you define a Swiz instance within a module or child view, simply removing it from the display list will cause Swiz to clean up the instance for you.
  • Performance and Memory improvements - We made it so Swiz's reflection system only captures and stores the metadata references it cares about. In many cases this has the effect of reducing the memory footprint of the reflection system by as much as 90%!
  • IServiceHelper and IURLRequestHelper - We took some good advice from the community and created IServiceHelper and IURLRequestHelper interfaces. Aside from just being good form, this will increase the testability of classes that use these helpers by allowing stub implementations to be provided under test.
  • ServiceHelper improvements - We also improved ServiceHelper by extending the ability to have extra arguments passed to your handler to include fault handlers. Result handlers have always had this ability and it can be extremely useful. Just like with result handlers, Swiz detects this automatically based on your method signature. Lastly, ServiceHelper::executeServiceCall() now returns the ASyncToken that is passed into the method.
  • Miscellaneous bug fixes - We fixed some minor issues with the tear down of pop ups and two way bindings, as well as other small improvements.
  • Metadata processor ordering - Metadata processors (both built-in and custom) are now sorted in descending order by their priority to more closely match the way event listener priorities work. We also tweaked the order of our built-in processors so that PreDestroy methods will actually run before an object's injections have been cleared.
  • CommandMap - Swiz now provides official, built-in support for the Command pattern! CommandMap is a new class that can be extended and dropped right into a BeanProvider. From the commit message: "Added CommandMap functionality to ease migration from frameworks like Cairngorm, and to accommodate developers/teams that may prefer the Command pattern. Our implementation borrows heavily from Robotlegs (robotlegs.org), because their implementation was clean and in line with our goals." Look for a blog post soon showing how to use this new feature!
  • IBeanFactory cleaned up - BeanFactory is really the heart of Swiz. It is responsible for boot strapping Swiz instances and generally managing the IoC container. We have cleaned up its IBeanFactory interface to be more consistent and predictable.
  • BeanEvent additions - Related to the IBeanFactory upgrades, we have improved BeanEvent as well. BeanEvent has been around for a while, with constants for SET_UP_BEAN and REMOVE_BEAN. Dispatching a BeanEvent with one of these types and an object instance attached would, respectively, set up (provide the dependencies and process the metadata declared by the object) or tear down (clear out the injected dependencies) the object. Part of the IBeanFactory improvements, however, were the distinctions between bean set up and tear down, and bean addition and removal. Adding a bean makes it available for injection into other objects, removing it makes it unavailable for injection. In order to allow all of these actions to be triggered by an event, we've added ADD_BEAN and REMOVE_BEAN to BeanEvent. One last note is that adding a bean will also set up that bean, but the opposite is not true; you can set up an object without making it available for others to inject. On the other end of the lifecycle, removing a bean will always tear the bean down, but tearing down does not imply removal. Among other reasons, this is because views may be removed from the stage and re-added, causing them to be torn down and then set up again.

For a complete list of changes made for this release you can use this compare view.

RC1 Release Notes

  • [Dispatcher], IDispatcherAware - You get a reference to the Swiz dispatcher either by decorating a property of type IEventDispatcher with [Dispatcher] or by implementing the IDispatcherAware interface. When using [Dispatcher] you can provide a scope attribute and give it a value of either "global" or "local". Global is the default and will provide you the shared dispatcher from the root Swiz instance. Local will give you the shared dispatcher from the Swiz instance that directly contains your object. Using the local dispatcher allows you to confine events to a child Swiz instance, such as within a module.
  • scope attribute on [Mediate] - Directly corresponds to the dispatchers discussed in the point above. This allows you to mediate events dispatched either by the local shared dispatcher or by the root dispatcher.
  • injectionEvent -> setUpEventType, etc. - The event handlers that Swiz uses to set up and tear down your views is now completely configurable. setUpEventType, setUpEventPhase, setUpEventPriority, tearDownEventType, tearDownEventPhase and tearDownEventPriority directly correspond to the values used in the listener creation by Swiz.
  • [PreDestroy] and IDisposable - You can use these to define code that should be run when tearing down your views such as cleaning up listeners or setting references to null. Note that this is called in response to the event specified by tearDownEventType, so when using the default of removedFromStage, your view will already be off of the display list by the time these methods are called.
  • IInitializing.init -> IInitializing.afterPropertiesSet() - To avoid conflict with UIComponent's method of the same name and to stay more consistent with Spring, the init() method of IInitializing has been changed to afterPropertiesSet().
  • Ant build - Full Ant build support!
  • Custom namespaces - This is pretty sweet. Swiz can now address code defined in custom namespaces automatically. If you cringe at having to make properties and methods public this feature is for you. Note that due to Flash Player restrictions we still cannot reach protected or private members, but we feel this is a really good compromise. Also note that Flex is not able to bind to non-public members.
  • Module and child Swiz support - You can now define child Swiz instances. This is very useful for modules, or potentially even deep dark views that users may never open in your application. When a Swiz instance is created it will dispatch a bubbling event from its host view component that will be caught by a parent Swiz instance further up the display list. A parent/child relationship is then established, allowing the child to inherit beans and configuration settings from its parent.
  • AIR window support - Support for separate native windows in AIR has been restored. To make this work you call swizInstance.registerWindow( myNewWindow ) before opening the window via myNewWindow.open(). This will allow Swiz to manage the window and its descendant views, and works by creating a Swiz instance inside the window and making swizInstance its parent.
  • Removed Outject - This turned out to be a bad idea so we yanked it.
  • Util classes renamed to helpers - ServiceRequestUtil and URLRequestUtil have been renamed to ServiceHelper and URLRequestHelper, respectively.
  • Chain API changes/updates - The chaining API has been cleaned up and made more consistent. IAutonomousChainStep has been added, which is an interface you can use to define steps that can execute themselves. The built in CommandChain and EventChain classes include support for these kinds of steps.
  • BeanEvent - BeanEvents can be used to manually control the injection and tear down phases for views and objects you attach to the event. Dispatching BeanEvent.SET_UP_BEAN will trigger Swiz to pass an object through it's injection and mediator processors. Dispatching BeanEvent.TEAR_DOWN_BEAN will trigger Swiz to remove any mediators and injection bindings it has created.
  • Removed setUpMarkerFunction - We briefly provided a way for users to determine whether or not a view should be wired up. This has been removed so that a proper, more robust API can be implemented in the future.
  • [Inject( bind="false" )] - Previously, when injecting bean properties with a tag like [Inject( "myModel.someProp" )], Swiz would create a binding if the source property was bindable. We have changed the default behavior so to make you choose to create bindings if you need them. To make Swiz to create a binding for you, you must set bind to true in the metadata tag. [Inject( "myModel.someProp", bind="true" )]. In general, using Inject with bindings should be treated carefully. We would like to discourage it's overuse, particularly in situations where users are creating global variables for their applications through the Inject tag.
  • No labels