2. How To Think In Terms Of Objects
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
- Define The Users: Define the users by the role which they will be playing while using the application.
- Object Behavior: List all of the behavior an object should have in order to function properly.
- Environment Constraints: Make a list of all the possible limitations which the physical environment can cause.
- 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.
- Identifying the Implementation: Think of what is needed in order to make the object functional.
Download Lesson Notes