flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com>
Subject Re: [FlexJS][Maven] Build failure caused by compiler warnings (was: Re: [FlexJS] How Binding works?)
Date Fri, 09 Dec 2016 19:03:17 GMT


On 12/9/16, 10:59 AM, "omuppi1@gmail.com on behalf of OmPrakash Muppirala"
<omuppi1@gmail.com on behalf of bigosmallm@gmail.com> wrote:

>On Fri, Dec 9, 2016 at 10:50 AM, Alex Harui <aharui@adobe.com> wrote:
>>
>> The binding warning is legitimate.  It says that there aren't change
>> events for data.foo.  That could bite you some day, but is ok in this
>> particular situation.  The "correct" answer is to use ValueObjects and
>> cast the data binding expression as I showed, but that can be a pain for
>> prototyping.  It turns out that with FlexJS, you can suppress this
>>binding
>> warning for simple binding expressions by making a fake ValueObject with
>> the required properties and casting.  The data binding code doesn't
>> type-check so you can get away with it.  I just pushed a prototype of an
>> ASDoc app with a fake ValueObject and suppressed warnings via casting in
>> the SummaryRenderer.mxml and DetailRenderer.mxml
>>
>>
>I am wondering if we should create a new marker interface like
>IBindableObject and use that in the data setter/getter?
>
>Something like:
>
>public function set data(v:IBindableObject) {
>}
>
>And my value objects look like this:
>
>[Bindable]
>public class SimpleVO implements IBindableObject {
>...
>}
>
>IBindableObject could just be an empty, i.e. marker interface.
>
>Then there is no need to cast in the code.  Also, maybe the compiler can
>be
>trained to not throw bindable warnings when it sees IBindableObject as the
>type?
>
>Not sure if I am missing something with this approach.

I don't think that would help.  The individual properties on data still
wouldn't have any change event metadata.

-Alex

Mime
View raw message