开发者

Flex 4: Nested components - Bad design?

Is it bad practice/design to nest components inside components using Flex 4? Should I simply be creating components and inserting them into my main application as below, or doesn't it matter?

<com:MyComp1>
    <com:MyComp2>
        <com:MyComp3>
            <s:Label text="This is a test."/>
        </com:MyComp3>
    </com开发者_JAVA百科:MyComp2>
</com:MyComp1>


If MyComp1, MyComp2 and MyComp3 are a containers then it's the recommended workflow. Custom containers in Flex 4 usually extend SkinnableContainerBase or Group. If the given code is used more than once then it's recommended to refactor it into a custom big component.

If they are not designed to contain unknown visual elements then it's a bad practice. Defining components inline is also known as bad practice in production code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜