Friday, October 30, 2009

Design and Code Review Checklist - scoping

Here is my scoping/access modifier cheat sheet.

Classes:

  • Public Class - Access is not restricted.
  • Private Class - Only valid for nested classes
  • Internal Class - only visible to the assembly

Members:

  • Private Member - only available to the containing type
  • Protected Member - Available to the containing type and anything derived from the containing type.
  • Internal Member - available to current assembly.
  • Protected Internal Member - Available to current assembly or anything derived from containing type.
  • Public Member - Access is not restricted

Valid Member Access Modifiers:

  • Enum - public
  • Interface - public
  • Class - public, private, internal, protected, protected internal
  • Struct - public, private, internal

Inheritance:

  • Abstract class - cannot be instantiated. May have abstract and non abstract methods. Derived class must implement all abstract methods.
  • Sealed Class - Cannot be inherited
  • Virtual Method - may be overridden
  • Abstract method - no implementation, must be overridden
  • Sealed method - Cannot be overridden
  • Sealed Override Method - No longer may be overridden. Public sealed override MyMeth()

 

(My design review checklist)

2 comments:

  1. Hi,

    Quite a good post. Would like to share a link for the knowledge where a quality analyst has shared some Code Review Checklist.

    Here is the link:
    http://www.mindfiresolutions.com/Code-Review-Checklist-238.php

    Hope you find it useful and of assistance.

    Thanks,
    Bijayani

    ReplyDelete
  2. Thanks Bijayani -

    I do encourage the readers of this post to have a look at the link you provided.

    Regards,
    Tim

    ReplyDelete