next up previous
Next: Field Naming Up: Naming Convention Previous: Package Naming

Class/Interface Naming

All type names (classes and interfaces) should use the InfixCaps style. Start with an upper-case letter, and capitalize the first letter of any subsequent word in the name, as well as any letters that are part of an acronym. All other characters in the name are lower-case. Do not use underscores to separate words. Class names should be nouns or noun phrases. Interface names depend on the salient purpose of the interface. If the purpose is primarily to endow an object with a particular capability, then the name should be an adjective (ending in -able or -ible if possible) that describes the capability; e.g., Searchable, Sortable, NetworkAccessible. Otherwise use nouns or noun phrases.
Examples:
    // GOOD type names:
    LayoutManager, AWTException,
    ArrayIndexOutOfBoundsException

    // BAD type names:
    ManageLayout // verb phrase
    awtException // first letter lower-case
    array_index_out_of_bounds_exception// underscores

Use Design Patterns, [EG94] naming convention to provide better meaning to the Class and Interface. Example:

     SSOEventListener
     MazeFactory
     BorderDecorator



Dennis Seah Mon Jul 17 11:43:42 2006