Hi Alex,

The short answer: to reduce migration pain.  My internal customer showed
> me a bunch of code with a lot of addElement() calls in it.
>
>
I thought migration was not considered in FlexJS. IMHO, I think that should
not be considered in the discussion of add to child vs add to parent.




> The long answer: I was looking at how addToParent() is currently
> implemented and found that I couldn't completely remember why I felt it
> was a better strategy.  Current Flex has tried two approaches so far, the
> main issue being: how do you manage children in a container?  The two
> approaches:
>
> 1) addChild + rawChildren.addChild
> 2) addElement goes to contentGroup (and block addChild)
>
> The choice for FlexJS is mainly about how to do it on the JS side.  We
> could use one of these two strategies, or use addToParent() or even go
> with the HTML/JS appendChild/insertChild, or something else.  I'm actually
> quite undecided at this point, which is why I hope the experiment will
> help finalize the decision.
>

When you proposed the change to addToParent I thought it was a great change.
I think one of the reasons was that actual mxml compilation to AS3 was
producing a less
performant way to build the displaylist tree and add to parent or bottom up
direction could be
better and more simple solution.




>
> So far, I've had the following thoughts:
>
> A) wrapping addChild messed up a lot of low-level tools like display list
> tree walkers used in Spy-like programs.  I'm leaning against wrapping
> addChild again.
> B) addToParent requires that the child have some knowledge about the
> parent.  Maybe it is better for the parent to have some knowledge about
> the child.
>

Why the child needs to know something about the parent beside some
interface or inheritance knowledge?
In my mind both methods seems to require the same knowledge...



> C) addToParent worked well for simple control composition, but when I
> ended up having to abstract out the actual parent when managing container
> children on the AS side I ended up with an "internal" addChild contract
> anyway.
>

could you elabore a bit more about this?


>
> Opinions and contributions always welcome,
>

One of the changes that make FlexJS a great promise is this addToParent
change...maybe now that you has more experience find that it's not as good
as it might seem, but since it was one of the great promises of the new
framework I'd like to discuss and help to find the main points for and
against to help take the decision.

Best

Carlos


> -Alex
>
>


-- 
Carlos Rovira
Director de TecnologĂ­a
M: +34 607 22 60 05
F:  +34 912 94 80 80
http://www.codeoscopic.com
http://www.directwriter.es
http://www.avant2.es

Reply via email to