I see your point about overrides. It looks like set strand() is not the place 
to load partner beads. If that’s the case, is it a bug that 
ContainerView.strand calls createViewport() which loads the model and the 
viewport?



From: Alex Harui<mailto:[email protected]>
Sent: Thursday, December 15, 2016 9:30 AM
To: [email protected]<mailto:[email protected]>
Subject: Re: [FlexJS] About Component Cycle and Events




On 12/14/16, 10:25 PM, "Yishay Weiss" <[email protected]> wrote:
>
>That was my intent, load it when necessary. My point was that there was
>no reason to attach event handlers when you need the bead, you can just
>check for its existence and load it if necessary.

I just took a look at strandutils.  Sure it packages up a common pattern
(check for bead, load bead from values manager), but I'm not understanding
how it would work if called from within the strand setter.  For example,
if in MXML, someone did:

<SomeComponent>
  <beads>
    <SomeBead />
    <AnotherBeadThatWorksWIthSomeBead />

I don't think SomeBead can use StrandUtils.  The desired partner bead is
about to be added to the strand right after SomeBead as an override for
the default partner bead that would be fetched from ValuesManager.  You
could require that overrides have to be before the other partner bead, but
some beads are peers and you can't really specify the order.

I think that's why we recommend using an event.  Once all beads are added,
you get an event if you want it, and can get events when beads are added
"later".

-Alex

Reply via email to