flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com>
Subject Re: FlexJS: Binding Issue
Date Mon, 19 Sep 2016 06:57:24 GMT

On 9/18/16, 2:47 AM, "PKumar" <prashakumar@gmail.com> wrote:

>BindingUtils class is useful to attach watcher on multiple properties or
>chain of properties. If i am having a custom class with large no. of
>properties  and if i want to detect the multiple properties changes  then
>will dispatch the events multiple times. Also i will have to extend the
>EventDispatcher class. overall, i will have to write more lines code to
>achieve the feature.

The basic component set in FlexJS may require you to write more lines of
code because we are trying to avoid big general purpose classes.  You can
always aggregate the pieces into a bigger general purpose class, and I
suspect that some bigger, more general component set will become the most
popular for FlexJS since it will make for faster prototyping, but it won't
make for faster, smaller applications.  There is a trade-off.

Even going from MX to Spark, your code went from looking like:

<mx:Application layout="vertical" />


    <s:VerticalLayout />

Why? Because MX Application bakes in AbsoluteLayout, HorizontalLayout and
VerticalLayout into every app, even if you only use VerticalLayout.

A similar thing is true everywhere in FlexJS.  The Flex BindingUtils uses
a generic ChangeWatcher that always expects a chain.  FlexJS has many
kinds of watchers and bindings that let you specify the right kind of
binding and watcher for a particular scenario.  We might just port over
BindingUtils because folks want it, but users of BindingUtils will have to
realize they are potentially bloating their app just for convenience in
development.  Plenty of times, folks end up replacing data binding to get
performance and use customized event listeners instead.  In FlexJS they
will also have the option of using different Binding classes.

FWIW, the "re-basing" of a class from extending Object to extending
EventDispatcher is a separate issue.  The compiler will do that if you use
[Bindable] metadata.


View raw message