加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Flex 3中组件的建议前缀命名约定是什么?

发布时间:2020-12-15 01:46:45 所属栏目:百科 来源:网络整理
导读:我正在寻找一种在Flex应用程序中命名组件的标准方法.例如,所有TextFields在其ID属性中以“txt”开头(即“txtFirstName”).有没有人熟悉我可以使用的前缀命名约定列表,而不是重新发明轮子? 解决方法 Adobe建议没有前缀约定,因为它们在组件实例名称中使用组件
我正在寻找一种在Flex应用程序中命名组件的标准方法.例如,所有TextFields在其ID属性中以“txt”开头(即“txtFirstName”).有没有人熟悉我可以使用的前缀命名约定列表,而不是重新发明轮子?

解决方法

Adobe建议没有前缀约定,因为它们在组件实例名称中使用组件的全名.

例如:usernameTextInput,userComboBox等.

If you want to incorporate the type into the name,make it the last “word”. Don’t use the old ActionScript 1 convention of concatenating abbreviated type suffixes such as _mc to indicate type. For example,name a border Shape border,borderSkin,or borderShape,but not border_mc.

更多信息:http://opensource.adobe.com/wiki/display/flexsdk/Coding+Conventions#CodingConventions-Naming

如果您确实想使用前缀,则可能需要使用VB前缀:http://www.rwc.uc.edu/cook/VBI_PREFIXES.HTM

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读