You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by yishayw <yi...@hotmail.com> on 2017/02/01 09:03:21 UTC

[FlexJS] Should override or aggregate?

Suppose you have a class A:

<Container>
  <beads>
     <ContainerDataBinding/>
  </beads>
  <Label text={str}"/>
</Container>

and then you use it like this:


  <beads>
     <DisabledBead/>
  </beads>


The beads collection will consist of [DisabledBead], not
[ContainerDataBinding, DisabledBead]. 

The result is that data binding won't work.

Is this a bug or a feature? I'm inclined to say it's a bug.



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-Should-beads-override-or-aggregate-tp58898.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [FlexJS] Should override or aggregate?

Posted by Alex Harui <ah...@adobe.com>.

On 2/2/17, 6:06 AM, "yishayw" <yi...@hotmail.com> wrote:

>I filed [1].
>
>Note that the same issue can happen in as3 classes. In [2], for example,
>we
>won't see the tooltip if there are other beads added by the user of this
>class. 

What is adding the beads in AS?  I don't recall any code that resets the
beads list.

>
>I propose to add IStrand.beadsReady() which is where implementers will add
>their default beads and check for the issues raised by Peter. We have an
>Event('beadsAdded') but that doesn't always get called, and it can get
>called more than once. Plus, I think having it as part of the interface
>will
>lessen the likelihood of implementers overlooking these issues.

IMO, the 80% case is folks just add the beads without conflict.  Other
code can negotiate if they expect conflict.  That would be more PAYG.

My 2 cents,
-Alex


Re: [FlexJS] Should override or aggregate?

Posted by yishayw <yi...@hotmail.com>.
I filed [1].

Note that the same issue can happen in as3 classes. In [2], for example, we
won't see the tooltip if there are other beads added by the user of this
class. 

I propose to add IStrand.beadsReady() which is where implementers will add
their default beads and check for the issues raised by Peter. We have an
Event('beadsAdded') but that doesn't always get called, and it can get
called more than once. Plus, I think having it as part of the interface will
lessen the likelihood of implementers overlooking these issues.

[1] https://issues.apache.org/jira/browse/FLEX-35254
[2] https://paste.apache.org/b6FI



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-Should-beads-override-or-aggregate-tp58898p58973.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [FlexJS] Should override or aggregate?

Posted by Carlos Rovira <ca...@codeoscopic.com>.
Hi,

since FlexJS has a significante change around composition localized in
beads maybe this is more important that it was in Flex
Said that, maybe this is not as crucial as other things and maybe it could
wait. Talking clear, if I had to choose between spend cycles
between get AMF working or getting beads append...the first wins clearly
for me. But is good to have this talk to see how could be done
and then postpone for a while



2017-02-01 19:45 GMT+01:00 Alex Harui <ah...@adobe.com>:

>
>
> On 2/1/17, 10:25 AM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
> <carlos.rovira@gmail.com on behalf of carlos.rovira@codeoscopic.com>
> wrote:
>
> >And what about to replace by default and to have a property
> >appendBeads=true/false (false default)
> >An advanced dev would make this true to allow beads to be appended instead
> >to remove all. And that "check"
> >is like they know how this works pros/cons.
> >
> >Other way could have a bead that called <js:Appender> and inside introduce
> >beads that we want to add (something like
> >the bead condition that was proposed some time ago)
>
> Maybe.  The first question is really:  how important is it to try to make
> MXML-based-on-MXML work better than it did in regular Flex?  In theory,
> because MXML for FlexJS outputs a data structure instead of code, it
> should be possible for MXMLDataInterpreter to do something more
> intelligent.  I'm actually surprised it didn't work for Yishay.
>
> Yishay, please file a JIRA with a test case and I will investigate more
> later.
>
> -Alex
>
>


-- 

Carlos Rovira
Director General
M: +34 607 22 60 05
http://www.codeoscopic.com
http://www.avant2.es

Este mensaje se dirige exclusivamente a su destinatario y puede contener
información privilegiada o confidencial. Si ha recibido este mensaje por
error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
proceda a su destrucción.

De la vigente Ley Orgánica de Protección de Datos (15/1999), le comunicamos
que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
S.A. La finalidad de dicho tratamiento es facilitar la prestación del
servicio o información solicitados, teniendo usted derecho de acceso,
rectificación, cancelación y oposición de sus datos dirigiéndose a nuestras
oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
necesaria.

Re: [FlexJS] Should override or aggregate?

Posted by Alex Harui <ah...@adobe.com>.

On 2/1/17, 10:25 AM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
<carlos.rovira@gmail.com on behalf of carlos.rovira@codeoscopic.com> wrote:

>And what about to replace by default and to have a property
>appendBeads=true/false (false default)
>An advanced dev would make this true to allow beads to be appended instead
>to remove all. And that "check"
>is like they know how this works pros/cons.
>
>Other way could have a bead that called <js:Appender> and inside introduce
>beads that we want to add (something like
>the bead condition that was proposed some time ago)

Maybe.  The first question is really:  how important is it to try to make
MXML-based-on-MXML work better than it did in regular Flex?  In theory,
because MXML for FlexJS outputs a data structure instead of code, it
should be possible for MXMLDataInterpreter to do something more
intelligent.  I'm actually surprised it didn't work for Yishay.

Yishay, please file a JIRA with a test case and I will investigate more
later.

-Alex


Re: [FlexJS] Should override or aggregate?

Posted by Carlos Rovira <ca...@codeoscopic.com>.
And what about to replace by default and to have a property
appendBeads=true/false (false default)
An advanced dev would make this true to allow beads to be appended instead
to remove all. And that "check"
is like they know how this works pros/cons.

Other way could have a bead that called <js:Appender> and inside introduce
beads that we want to add (something like
the bead condition that was proposed some time ago)



2017-02-01 17:50 GMT+01:00 Josh Tynjala <jo...@gmail.com>:

> Yes, I seem to recall the lbl3 will completely replace lbl1 and lbl2. I
> made it a rule never to extend an MXML class in my projects. A new class
> could only extend an ActionScript class.
>
> - Josh
>
> On Wed, Feb 1, 2017 at 7:56 AM, Alex Harui <ah...@adobe.com> wrote:
>
> >
> >
> > On 2/1/17, 1:30 AM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
> > <carlos.rovira@gmail.com on behalf of carlos.rovira@codeoscopic.com>
> > wrote:
> >
> > >For me this is a missing feature that turns into a bug.
> > >Maybe we could have two beads array. The actual could be the one uses
> > >"static beads"
> > >and other array used for developers to add and remove to avoid affect
> the
> > >internal one
> >
> > Without looking into it, this sounds like a classic Flex problem.  When
> > you use an MXML file as the base class of another MXML file, and both
> > specify values for an array property, what really should happen?
> >
> > An even more common problem is this:
> >
> > <!-- Base.mxml -->
> > <s:Group>
> >   <s:Label id="lbl1" />
> >   <s:Label id="lbl2" />
> > </s:Group>
> >
> > <!-- UseOfBase.mxml -->
> > <local:Base>
> >   <s:Label id="lbl3" />
> > </local:Base>
> >
> > Where should lbl3 go?  Before or after lbl1 and lbl2?  Or replace lbl1
> and
> > lbl2?  I think the Flex MXMLC compiler results in replacement.
> >
> > That said, I tried to fix this for MXMLContent in Falcon/FalconJX.  And I
> > would have expected beads to append so IMO there is a bug in there,
> > although before just fixing it, it would be good to understand the
> > ramifications of such a fix.
> >
> > -Alex
> >
> >
>



-- 

Carlos Rovira
Director General
M: +34 607 22 60 05
http://www.codeoscopic.com
http://www.avant2.es

Este mensaje se dirige exclusivamente a su destinatario y puede contener
información privilegiada o confidencial. Si ha recibido este mensaje por
error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
proceda a su destrucción.

De la vigente Ley Orgánica de Protección de Datos (15/1999), le comunicamos
que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
S.A. La finalidad de dicho tratamiento es facilitar la prestación del
servicio o información solicitados, teniendo usted derecho de acceso,
rectificación, cancelación y oposición de sus datos dirigiéndose a nuestras
oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
necesaria.

Re: [FlexJS] Should override or aggregate?

Posted by Josh Tynjala <jo...@gmail.com>.
Yes, I seem to recall the lbl3 will completely replace lbl1 and lbl2. I
made it a rule never to extend an MXML class in my projects. A new class
could only extend an ActionScript class.

- Josh

On Wed, Feb 1, 2017 at 7:56 AM, Alex Harui <ah...@adobe.com> wrote:

>
>
> On 2/1/17, 1:30 AM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
> <carlos.rovira@gmail.com on behalf of carlos.rovira@codeoscopic.com>
> wrote:
>
> >For me this is a missing feature that turns into a bug.
> >Maybe we could have two beads array. The actual could be the one uses
> >"static beads"
> >and other array used for developers to add and remove to avoid affect the
> >internal one
>
> Without looking into it, this sounds like a classic Flex problem.  When
> you use an MXML file as the base class of another MXML file, and both
> specify values for an array property, what really should happen?
>
> An even more common problem is this:
>
> <!-- Base.mxml -->
> <s:Group>
>   <s:Label id="lbl1" />
>   <s:Label id="lbl2" />
> </s:Group>
>
> <!-- UseOfBase.mxml -->
> <local:Base>
>   <s:Label id="lbl3" />
> </local:Base>
>
> Where should lbl3 go?  Before or after lbl1 and lbl2?  Or replace lbl1 and
> lbl2?  I think the Flex MXMLC compiler results in replacement.
>
> That said, I tried to fix this for MXMLContent in Falcon/FalconJX.  And I
> would have expected beads to append so IMO there is a bug in there,
> although before just fixing it, it would be good to understand the
> ramifications of such a fix.
>
> -Alex
>
>

Re: [FlexJS] Should override or aggregate?

Posted by piotrz <pi...@gmail.com>.
I'm with Peter - Such feature like composite bead in that case will generate
many bugs once we implement it. 

Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-Should-beads-override-or-aggregate-tp58898p58940.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [FlexJS] Should override or aggregate?

Posted by Peter Ent <pe...@adobe.com>.
If <js:beads> on a composed component can be appended by using the
component with its own beads, then you run the risk of duplicate beads
that might cause unpredictable results. A developer may not know what
beads a composed component might already have added to the strand.

We also have to then write beads to handle multiple "beadsAdded" events.
Right now, some beads wait for "beadsAdded" before creating the visual
elements or change the visual based on the beads added. Beads would have
to determine if they've already been down the beadsAdded path before and
decide to a) wipe out what they've done and do it over, b) ignore the new
event, c) blend new information into old, d) something else?

What happens if I make a component from Container and add in
HorizontalLayout and then someone uses my component but adds
VerticalLayout? Both layouts are then active and both beads will/may
receive the layoutNeeded event. I guess the developer that uses it will
see some sort of chaos happening and investigate, but this just leads to
longer development times to sort these things out.

I can offer no solution to this accept to say that appending the beads
would yield many more problems then replacing them. And if they are
replaced, I think we need an event ("beadsRemoved") be sent so that any
beads which might be active and consuming resources can close down
properly.

Peter Ent
Adobe Systems/Apache Flex Project



On 2/1/17, 10:56 AM, "Alex Harui" <ah...@adobe.com> wrote:

>
>
>On 2/1/17, 1:30 AM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
><carlos.rovira@gmail.com on behalf of carlos.rovira@codeoscopic.com>
>wrote:
>
>>For me this is a missing feature that turns into a bug.
>>Maybe we could have two beads array. The actual could be the one uses
>>"static beads"
>>and other array used for developers to add and remove to avoid affect the
>>internal one
>
>Without looking into it, this sounds like a classic Flex problem.  When
>you use an MXML file as the base class of another MXML file, and both
>specify values for an array property, what really should happen?
>
>An even more common problem is this:
>
><!-- Base.mxml -->
><s:Group>
>  <s:Label id="lbl1" />
>  <s:Label id="lbl2" />
></s:Group>
>
><!-- UseOfBase.mxml -->
><local:Base>
>  <s:Label id="lbl3" />
></local:Base>
>
>Where should lbl3 go?  Before or after lbl1 and lbl2?  Or replace lbl1 and
>lbl2?  I think the Flex MXMLC compiler results in replacement.
>
>That said, I tried to fix this for MXMLContent in Falcon/FalconJX.  And I
>would have expected beads to append so IMO there is a bug in there,
>although before just fixing it, it would be good to understand the
>ramifications of such a fix.
>
>-Alex
>


Re: [FlexJS] Should override or aggregate?

Posted by Alex Harui <ah...@adobe.com>.

On 2/1/17, 1:30 AM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
<carlos.rovira@gmail.com on behalf of carlos.rovira@codeoscopic.com> wrote:

>For me this is a missing feature that turns into a bug.
>Maybe we could have two beads array. The actual could be the one uses
>"static beads"
>and other array used for developers to add and remove to avoid affect the
>internal one

Without looking into it, this sounds like a classic Flex problem.  When
you use an MXML file as the base class of another MXML file, and both
specify values for an array property, what really should happen?

An even more common problem is this:

<!-- Base.mxml -->
<s:Group>
  <s:Label id="lbl1" />
  <s:Label id="lbl2" />
</s:Group>

<!-- UseOfBase.mxml -->
<local:Base>
  <s:Label id="lbl3" />
</local:Base>

Where should lbl3 go?  Before or after lbl1 and lbl2?  Or replace lbl1 and
lbl2?  I think the Flex MXMLC compiler results in replacement.

That said, I tried to fix this for MXMLContent in Falcon/FalconJX.  And I
would have expected beads to append so IMO there is a bug in there,
although before just fixing it, it would be good to understand the
ramifications of such a fix.

-Alex


Re: [FlexJS] Should override or aggregate?

Posted by Carlos Rovira <ca...@codeoscopic.com>.
For me this is a missing feature that turns into a bug.
Maybe we could have two beads array. The actual could be the one uses
"static beads"
and other array used for developers to add and remove to avoid affect the
internal one

2017-02-01 10:23 GMT+01:00 yishayw <yi...@hotmail.com>:

> In App [1] I set MyContainer [2] to disabled. This overrides the
> DataBinding
> bead so label doesn't show. The problem is not specific to binding, any
> component with beads will be overridden this way.
>
> [1] https://paste.apache.org/UAcn
> [2] https://paste.apache.org/dWWN
>
>
>
> --
> View this message in context: http://apache-flex-
> development.2333347.n4.nabble.com/FlexJS-Should-beads-
> override-or-aggregate-tp58898p58902.html
> Sent from the Apache Flex Development mailing list archive at Nabble.com.
>



-- 

Carlos Rovira
Director General
M: +34 607 22 60 05
http://www.codeoscopic.com
http://www.avant2.es

Este mensaje se dirige exclusivamente a su destinatario y puede contener
información privilegiada o confidencial. Si ha recibido este mensaje por
error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
proceda a su destrucción.

De la vigente Ley Orgánica de Protección de Datos (15/1999), le comunicamos
que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
S.A. La finalidad de dicho tratamiento es facilitar la prestación del
servicio o información solicitados, teniendo usted derecho de acceso,
rectificación, cancelación y oposición de sus datos dirigiéndose a nuestras
oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
necesaria.

Re: [FlexJS] Should override or aggregate?

Posted by yishayw <yi...@hotmail.com>.
In App [1] I set MyContainer [2] to disabled. This overrides the DataBinding
bead so label doesn't show. The problem is not specific to binding, any
component with beads will be overridden this way.

[1] https://paste.apache.org/UAcn
[2] https://paste.apache.org/dWWN



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-Should-beads-override-or-aggregate-tp58898p58902.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [FlexJS] Should override or aggregate?

Posted by piotrz <pi...@gmail.com>.
Hi Yishay,

Can you post whole example? Not sure how it is connected.

Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-Should-beads-override-or-aggregate-tp58898p58900.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.