2009-05-13

Naming Convention

Allowed Conventions

Camel Notation
  • Only alphanumeric charaters are allowed.
  • Separation of words are denoted using capital letter(cap)
  • example : PurchaseOrder, StockTrading, orderNo, itemNum, totalPrice
  • prefered for name of : Java source file, Java identifiers and variables, HTML and JSP file
Hungarian Notation
//@TODO
Small Letter with Dash Separator
  • Only small letters(a-z), numbers(0-9) and dash(-) are allowed.
  • Separation of words are denoted by dash(-)
  • example : purchase-order, stock-trading, order-no, item-num, src-dir, system-id, build-hibernate.xml, config-ibatis.xml, mi.conf
  • prefered for name of : XML file, XML element, directory, image file, configuration file, property placeholder
Small Letter with Underscore Separator
  • Only small letters(a-z), numbers(0-9) and underscore(_) are allowed.
  • Separation of words are denoted by underscore(_)
  • example : purchase_order, stock_trading, order_no, item_num
  • prefered for name of : database column, database table
Capital Letter with Underscore Separator
  • Only capital letters(A-Z), numbers(0-9) and underscore(_) are allowed.
  • Separation of words are denoted by underscore(_)
  • example : PURCHASE_ORDER, STOCK_TRADING
  • prefered for name of : database table, OS environment variable

Not Allowed Conventions

Mixture of capital letters, small letters and underscore
  • example : order_TotalPrice, int_maxSeq
Mixture of capital letters, small letters and dash
  • example : order-TotalPrice, int-maxSeq

References

No comments:

Post a Comment