Basics of Object-Oriented Programming


  • Sequential Processing - Line 1, Line 2, Line 3, etc..., Last Line
  • Subroutines - A small piece of program code that is designed to perform a specific task more than once
  • Calling a subroutine - Program flow is temporarily redirected to the subroutine
  • Functions - Much like a subroutine, but they can return a data value when it is done processing the data
  • Previous programming concepts focused on defining the data and writing subroutines and functions to manipulate the data in a way that the solution to the problem became known
  • Class - blue print for creating an object
  • Object - data and code combined in a single concept
  • Object-Oriented Programming (OOP) combines the data and the code into a single concept called an object
  • Object-Oriented Design (OOD) - Designing solutions to problems by using object-oriented priciples
  • To be considered an object-oriented language, a language needs the following pieces:
    • Encapsulation - Data for an object and the instructions that operate on that data are part of the object itself
    • Inheritance - Extending an object to create new objects
    • Polymorphism - Sending the same message to different objects causes each object to process the message in its own distinct way
  • Properties (attributes) - Data that describe the object
  • Interface - Methods used to access the object's properties
  • Namespace - collection of classes, other namespaces, and methods