Fluent NHibernate
Coding Standards And Best Practices (changes)

Showing changes from revision #2 to #3: Added | Removed

This is a quick list of coding standards and other best practices to follow when writing patches or making submissions. In general, the MS Best practices should be followed when not explicitly specified in this document.

Casing:

  • Private Field: camelCase
    private int someField;

  • Private Method: Pascal Case?,PascalCase, Argument: camelCase
    private int SomeMethod(int argOne);

  • Public Property/Field: Pascal Case?PascalCase
    public int SomeField;

  • Public Method: Pascal Case?,PascalCase, Argument: camelCase
    public int SomeMethod(int argOne);

  • Generic Type: T prefix, then Pascal Case?PascalCase
    public TClass SomeMethod<TClass>();

General:

  • Brace position: New Line
    Function()
    {
    }

  • Number of Class/Interface/Enum/Type declared per file: *1*
    file: MappingClass.cs
    file: IMapping.cs
    file: EnumMapping.cs

  • Return types for fluent method chains: Interfaces
    public IProperty SetColumn(string columnName)
    {
    }