wiki:BudvaCodingStyleGuide

Naming

Class names:

  • W (prefix): For wrapped nodes. Example: WSeq.
  • I (prefix): Whenever a component does not have a concrete implementation, but is rather meant to be used as an interface. Example: IRdfRepository

Method names:

  • create: For factory methods.
  • begin/end, open/close: for delimiting sections of code. Example: beginTransaction(), endTransaction()
  • force: Throw an exception if a condition is not met. Example: forceIsReadable()
  • forced (suffix): Throw an exception if something is missing. Example: getObjectForced()
  • conditionally (suffix): If an action is only invoked if certain conditions are met. Example: commitChangesConditionally()
  • safely (suffix): Provide a default or auto-create if something is missing. Example: getEntrySafely()
  • Controlled overriding (pattern): Prevent subclasses from completely deactivating your method foo() by making it final and invoking abstract methods in it.
    • before: invoked before the method to be "overridden". Example: beforeFoo()
    • inside: invoked inside the overridden method. Example: insideFoo()
    • after: invoked after the overridden method. Example: afterFoo()
Last modified 16 years ago Last modified on 08/25/06 12:41:05