Saturday, September 25, 2010

Signs you need to create a new class

  1. One of your classes is getting too large, has too many members doing too many things
  2. The function signatures of one of your classes are getting too large (3-4 parameters is about the limit, and typically you want to have 0-2 parameters). 
  3. There are subparts that need to be updated with time and yet they're handled from the main class (consider another class with an update loop)
  4. You are trying to maintain subparts in parallel (e.g. 2 lists that should be in sync with each other)

No comments:

Post a Comment