- terminology
- class--a type of object (like a data type)
- object--an instance of a class (like a variable)
- class defines the characteristics shared by all of its instances
- each object is different from others by the values of the data stored in them
- operations are common
- Interface
- define the interface and make it available for all objects to use
- the implementation and data are hidden
- the interface is the declarations of the operations
- it may include other classes, data structures, and constants
- Class versus Object
- an object is an entity that comes into existence when needed in a program; occupies memory when created and is deleted when it is no longer needed
- a class is an abstraction--it does not exist in memory but is used as a template to describe attributes and operations for an object
New Way of Thinking about Problem Solving
- planning is now different
- find common objects in the problem and design classes
- identifying classes and objects is one of the hardest parts of OOP programming
Problem Solving Steps
- analyze the problem and the environment
- you want to model the problem
- identify classes of objects
- the necessary behavior of the class
- what is the same about objects in the environment
- what is different about them