My favorites | Sign in
Project Home Downloads Issues Source
Project Information
Members
Featured
Downloads
Links

BindMax is a lightweight, flex-less data binding alternative for AS3 applications.

Flex data binding is not bad, it’s good—it works. But it does require you to include the flex.swc in your project which increases file size. It also utilizes the Flash event architecture, which is slightly slow, and it generates a lot of code for you at compile time. BindLite replaces all of this with a lightweight binding architecture which also adds compile time type checking.

Data binding is essentially tha synchonization of values, typically between the model and the views (read more here. For Flex applications data binding is typically accomplished with the Bindable compiler meta tag. For pure AS3 applications it’s been a roll-your-own world and some even use Bindable here as well. This is just wrong.

These are the reasons why BindMax is better than Bindable:

  • Mobile loving
Building mobile apps with AIR? Then you know it’s all about squeezing file size out and performace in. BindMax is an implementation of the observer pattern, which is a much simpler structure than the Flash Event bus. In fact it’s beautiful minimalism compared the Events. Smaller file size, better performance.
  • Speed!
For primitive data types BindMax is generally 3x faster than Bindable. Performance with complex data types obviously depends on how fast your compare functions are, if you have any. Without them, complex data types propagate just as fast as the primitve ones. The speed tests are included with the source so check for yourself!
  • Early type checking
A data binding is usually defined early in the application run cycle. When that happens, BindMax will evaluate each attempt to bind a property or setter against the data type of the binding and throw an error if the data types don’t match. With Bindable, you get no errors until the target property/setter for that binding is used. For a property that is used only rarely, you may never even see that error until the client/user stumbles over that rare use case and tells you.
  • Boot time property/getter/setter name validation on both sides of data binding
Just as with type checking, BindMax validates that that the names match between the property or setter you bind a property or getter to.
  • Easy custom compare functions for complex and custom data types
Primitive data type values like numbers and strings are easy to compare. Complex data types like arrays, dictionaries and custom objects require special handling. For this scenario, BindMax provides setCompareFunction which lets you pass it a function reference to a custom function that takes two instances of the same class and returns true if they are equal.
  • Optional automatic binding disposal
To play nice with the garbage collector, BindMax lets you turn on automatic disposal of bindings which are no longer in use. When the last target for a binding is removed, BindMax will dispose of it.
  • Previous value retrieval
BindMax stores the last value of each binding so you can retrieve it with retrieveLast if for comparison with the new value. The typical use case for this functionality is an animated image gallery where animation direction is determined based on image index vs previous image index. I’m sure you can think of several others.
  • bold*Powerful reset function
With the reset function, you can reset any or all of the bound properties to their default values (value of the property when the binding was defined). A quick call to reset followed by propagateAll will effectively reset you application.
  • Propagation forcing
There are times when checking if a value is in fact changed simply doesn’t make sense. Then you wanna be sure that a value spreads to you application each time it is set, even if hasn’t changed. BindMax lets you override change detection on a per-update or per-property basis.
Powered by Google Project Hosting