Wednesday, September 1, 2010

OOP Terminology

Along with each programming revolution comes a new set of terminology. There are some new OOP concepts, but many have a simple analog in pre-OOP practice.
OOP Term Definition
method Same as function, but the typical OO notation is used for the call, ie, f(x,y) is written x.f(y) where x is an object of class that contains this f method.
send a messageCall a function (method)
instantiateAllocate a class/struct object (ie, instance) with new
class A struct with both data and functions
object Memory allocated to a class/struct. Often allocated with new.
member A field or function is a member of a class if it's defined in that class
constructorFunction-like code that initializes new objects (structs) when they instantiated (allocated with new).
destructorFunction-like code that is called when an object is deleted to free any resources (eg, memory) that is has pointers to.
inheritanceDefining a class (child) in terms of another class (parent). All of the public members of the public class are available in the child class.
polymorphismDefining functions with the same name, but different parameters.
overload A function is overloaded if there is more than one definition. See polymorphism.
override Redefine a function from a parent class in a child class.
subclass Same as child, derived, or inherited class.
superclassSame as parent or base class.
attribute Same as data member or member field.

No comments:

Post a Comment