Object-Oriented Programming glossary
33 terms you will meet in the free Object-Oriented Programming course, each explained in one or two sentences.
A
- Abstract class
- A class that cannot be instantiated and may declare methods that subclasses must implement.
- Abstraction
- Working with what an object does through a simple interface while hiding how it does it.
C
- Class
- A blueprint that defines the fields and methods shared by a kind of object.
- Cohesion
- How closely the parts of a class serve one single purpose; high cohesion is good.
- Composition
- Building objects from other objects they hold in fields (a has-a relationship).
- Constructor
- A special method that runs when an object is created and sets up its starting state.
- Coupling
- How much one class depends on the details of another; low coupling is good.
D
- Delegation
- Forwarding a method call to a helper object instead of doing the work directly.
- Dependency injection
- Passing an object's collaborators in from outside, usually through the constructor.
- Design pattern
- A named, reusable solution to a common design problem, such as strategy or observer.
- Duck typing
- Treating an object as usable if it has the needed methods, regardless of its class.
- Dynamic dispatch
- Choosing which method implementation runs at run time, based on the actual object.
E
- Encapsulation
- Hiding an object's data and allowing access only through its own methods.
F
- Field
- A variable that belongs to an object; also called a property or attribute.
G
- Getter
- A method that is read like a field, often used for computed or read-only values.
I
- Immutable
- Unable to change after creation; changes produce new objects instead.
- Inheritance
- Defining a class as an extension of another, reusing its fields and methods.
- Instance
- One concrete object created from a class.
- Interface
- A contract listing methods a class promises to provide, without implementation.
- Invariant
- A rule that must always be true for an object to be valid, such as a balance never being negative.
L
- Liskov substitution principle
- Subclass objects must work anywhere their parent is expected without breaking the program.
M
- Method
- A function defined in a class that operates on an instance's data.
O
- Object
- A bundle of state (fields) and behavior (methods) that represents one thing in a program.
- Overriding
- Redefining an inherited method in a subclass.
P
- Polymorphism
- The ability of different objects to respond to the same method call in their own way.
S
- SOLID
- Five design principles: single responsibility, open-closed, Liskov substitution, interface segregation and dependency inversion.
- Static member
- A field or method that belongs to the class itself rather than to any one instance.
- Subclass
- A class that extends another; also called child or derived class.
- Superclass
- The class another class extends; also called parent or base class.
T
- Test double
- A stand-in for a real collaborator in a test, such as a stub, fake or mock.
- this / self
- The reference, inside a method, to the object the method was called on.
U
- UML class diagram
- A standard diagram showing classes as boxes and their relationships as lines.
V
- Value object
- An object defined only by its values, such as an amount of money, usually immutable.
Put these terms to work
The Object-Oriented Programming course uses every one of these terms in short lessons with instant-feedback questions. It takes about 160 minutes and ends with a free certificate of completion.
Start the course Course overview