ITEC 2610 Chapter Notes - Chapter 8: Object-Oriented Programming, Unified Modeling Language, Mutator Method
Document Summary
A class represents a single concept from the problem domain. Name for a class should be a noun that describes concept. Actors (end in -er, -or) objects do some kinds of work for you: Utility classes no objects, only static methods and constants: Program starters: a class with only a main method. The class name should indicate what objects of the class will do: paycheck is a better name than. Don"t turn a single operation action into a class: paycheck is a better name than. Answer: look for nouns in the problem description. Your job is to write a program that plays chess. A class should represent a single concept. The public interface of a class is cohesive if all of its features are related to the concept that the class represents. The members of a cohesive team have a common goal. It contains two concepts: a cash register that holds coins and computes their total.