Some Basic Terminology
In object-oriented programming, you write code to define new data types, or classes, to represent abstract items. These classes contain properties that represent the fundamental information needed to describe an item. Along with these properties, I can associate operations, called methods or member functions, which you would normally want to perform on those items.
When you create an instance of a class, you have created an object. Therefore, for the products in Beth's Boating Supplies warehouse, I could define a class called
Product. This class would have the properties I saw previously, in addition to two member functions or methods:
Product class: Properties: - product id - product name - description - price per unit - supplier location Methods: - get number in stock - add one to an order
An object instance of this class would be one of these
Product classes instantiated with the information for a particular product:
Product instance for a fly-fishing lure: Properties: - product id -- 334355-XR1 - product name Joe's Awesome Winter Lure - description -- Joe's lures are amazingly popular with... - price per unit -- 19.99 - supplier location -- local warehouse Methods: - get number in stock - add one to an order