Extended Camel Case


Extended Camel Case is used in some fixtures, to have fewer rules about what (ASCII) characters are permitted. It allows for arbitrary characters in the header names of columns or the names of actions. Each character that is not valid in a Java identifier is converted into a word (with a leading space).

For example:

Name in tablePartial conversionConverted to program identifier
one dayone dayoneDay
one + dayone plus dayonePlusDay
+plusplus
#{hash left bracehashLeftBrace
:-)colon minus right parenthesiscolonMinusRightParenthesis
%agepercent agepercentAge
% agepercent agepercentAge
age%age percentagePercent
cost in $scost in dollarscostInDollars
hire @hire athireAt

For examples of the use of ExtendedCamelCase, see DoFixture and CalculateFixture.

The character conversions are as follows:

charword(s) with leading space
! bang
" quote
# hash
$ dollar
% percent
& ampersand
' single quote
( left parenthesis
) right parenthesis
* star
+ plus
, comma
- minus
. dot
/ slash
: colon
; semicolon
< less than
> greater than
= equals
? question
@ at
[ left square bracket
] right square bracket
\ backslash
^ caret
` backquote
{ left brace
} right brace
  bar (not usable with wiki)
~ tilde

But isn't it a pain to work out what the name of the method is if there are lots of special characters?

Just write an empty fixture class and run Fit. It will tell you the method expected; you can copy it from the error message and paste it into your code.

RickMugridge

 

Last edited May 11, 2004
Return to WelcomeVisitors