2. How To Think In Terms Of Objects


More Info:

This lesson is fairly simple and does not have much going on. Although I believe it is fairly simple I also believe is is very important because it gices us some guidance on how to properly design our classes, interfaces, and implementations.

Ill break it down for those who want to quick version without examples. The main points are:

  • Use as few Interfaces as possible and only create the interfaces which are ABSOLUTELY necessary.
  • An Interface is public methods which other classes have access to.
  • An Implementation is private code which is not accessable to other classes.
  • Create classes or methods based on how useful and reusuable it can be in that project.

Steps to Creating a Class

  1. Define The Users: Define the users by the role which they will be playing while using the application.
  2. Object Behavior: List all of the behavior an object should have in order to function properly.
  3. Environment Constraints: Make a list of all the possible limitations which the physical environment can cause.
  4. Identifying the Public Interfaces: Think of how the object is used and not how it's built. Each interface must contribute to the operation of the object.
  5. Identifying the Implementation: Think of what is needed in order to make the object functional.


Download Lesson Notes

The Object-Oriented Thought Process

Author: Matt Weisfeld