On 10/13/13 5:58 PM, "Maurice Amsellem" <maurice.amsel...@systar.com>
wrote:

>>That might be a flaw in the design.  I think other Spark components have
>>a content property that can take a textFlow.
>>Then it is left to the skin designer to grab the right property from the
>>model and display it in the view/skin.
>
>Shouldn't that be done in the hostComponent (eg. in partAdded) ?
Yes, you are correct about that.  I keep forgetting that Spark pushes data
to the skin parts.
>
>>I haven't looked at the Alert code, but it sounds like the design may
>>not be correct.  In FlexJS the Alert is not a Container for similar
>>reasons.
>I agree that since the content is fixed, it should not be a
>SkinnableContainer.
>But on the other hand it needs to be displayed in a Panel Skin frame.
>How would you do that without  inheriting Alert from Panel and without
>"duplicating" the code from PanelSkin?
And this is sort of why FlexJS uses composition instead of inheritance.
There is no good answer in Spark and we often did duplicate code.  See the
three copies of prompt text handling for example.  IMO, you want to hide
any APIs that invite the user to add new content to the Alert so you'd
have to @exclude various addElement/removeElement APIs if Alert extends
SkinnableContainer.  Duplication of code is bad but there is precedence
for doing it.  The choice is yours...

-Alex

Reply via email to