命名规范

 A Proposal: Code Standard for IIR Flex Projects
Started by Andy, August 20th, 2007
Last updated by Andy, August 21st, 2007
Purpose: to make our source code easier to maintain.

Content List
1. Event Handler 3
2. Database 3
3. File Name 3
4. Folders 3
5. Naming 4

1. Event Handler

? For built in event, we use the name_event:

<mx:Image id=”imgTest1” click=” imgTest1_click()” mouseDown=” imgTest1_ mouseDown ()”
mouseOut=” imgTest1_ mouseOut ()”/>

? Naming of event parameters: event
private function btnTest(event:Event):void {

? Self defined event:
<mx:Metadata>[Event(name="EventUpdated", type="flash.events.Event")]</mx:Metadata>


2. Database
? Database field name:
Company_Product
Product_Attribute


3. File Name
? Start with upper case:
RendererLogin.mxml

 

4. Folders
There will be folders:
? Image
? Flash
? Swc

5. Naming
Names and Prefixes

Prefixes tell what type of variable or component.

Array: a
ArrayCollection: ac
ApplicationControlBar: bar
Accordion: acd
AreaChart: chart
AddChild: add
BarChart: chart
BubbleChart: chart
Button: btn
ButtonBar: bar
Boolean: b
CandlestickChart: chart
ColumnChart: chart
ControlBar: bar
CheckBox: cbx
ComboBox: cmb
Class: NO PREFIX (or cls)
ColorPicker: color
Canvas: cvs
DateField: date
DateChooser: date
Date: date
DataGrid: dg
DataGridColumn: dgc
dataProvider: NO PREFIX
Error: err
FileReference: file
Form: frm
FileSystemComboBox: cmb
FileSystemDataGrid: dg
FileSystemHistoryButton: btn
FileSystemList: lst
FileSystemTree: tr
Grid: gd
GridRow: gr
GridItem: gi
HTML: htm
HLOCChart: chart
HRule: rul
HSlider: sld
HorizontalList: lst
HDividedBox: hdb
HBox: box
htmlText: txt
FormHeading: head
Iris: ef
Image: img
Int: i
Legend: lgd
LineChart: chart
Label: lbl
List: lst
LinkButton: btn
LinkBar: bar
MenuBar: bar
NumericStepper: ns
Number: f
NumberFormatter: fmt
Object: o (or NO PREFIX)
PieChart: chart
PlotChart: chart
PopUpButton: btn
PopUpMenuButton: btn
ProgressBar: pb
Panel: pnl
Parallel: ef
QiAgent: qi
RichTextEditor: txt
RadioButtonGroup: rbg
RadioButton: rbtn
Resize: ef
String: s
SWFLoader: swf
Spacer: spc
states: NO PREFIX
State: NO PREFIX
SetProperty: set
SetStyle: set
Sequence: ef
TabBar: bar
TabNavigator: nav
Tree: tr
TileList: lst
TitleWindow: win
Text: txtName
TextArea: txt 
TextInput: txt
ToggleButtonBar: bar
Timer: t
Tile: tile
VBox: box
ViewStack: vs
VSlider: sld
VDividedBox: box
VRule: rul
VideoDisplay: vdo
WipeLeft: ef
WipeRight: ef
WipeDown: ef
WipeUp: ef
XML: xml

 

  parentApplication.localObject.CompanyProfile_Name
     Local_Config.local_arrAllLevelInfo

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值