4

I'm looking for a standard way to name components in my Flex application. For example, all TextFields begin with "txt" in their ID attribute (i.e., "txtFirstName"). Rather than re-invent the wheel, is anyone familiar with a list of prefix naming conventions that I can use?

Christophe Herreman
  • 15,895
  • 9
  • 58
  • 86
Huuuze
  • 15,528
  • 25
  • 72
  • 91

2 Answers2

5

There is no prefix convention that Adobe recommends since they use the full name of the component in a component instance name.

For instance: usernameTextInput, userComboBox, etc.

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.

More info: http://opensource.adobe.com/wiki/display/flexsdk/Coding+Conventions#CodingConventions-Naming

If you really want to use prefixes, you might want to use the VB prefixes: http://www.rwc.uc.edu/cook/VBI_PREFIXES.HTM

Christophe Herreman
  • 15,895
  • 9
  • 58
  • 86
1

Check out Adobe's Flex Coding Conventions document. Most of the flex code you see stays pretty true to this coding standard.

Nik Reiman
  • 39,067
  • 29
  • 104
  • 160