ITEC30 - 1

ITEC30 - Introduction to Object-Oriented Programming

PRESENTATION OUTLINE

  • 01 Programming Paradigm

  • 02 Procedural Programming Paradigm VS Object-Oriented Programming Paradigm

  • 03 What is Object-Oriented Programming?

  • 04 Object-Oriented Programming Principles

  • 05 Object-Oriented Programming Languages

  • 06 Benefits of Object-Oriented Programming Languages

WHAT IS PROGRAMMING PARADIGM?

  • Programming Paradigm:

    • Refers to a style of programming that provides a framework for solving problems.

    • Two main categories:

    • Imperative Paradigm:

      • Focus on the sequence of commands executed to achieve a result.

    • Examples include Procedural programming.

    • Declarative Paradigm:

      • Focus on what the program should accomplish without specifying how to achieve it.

PROCEDURAL PROGRAMMING PARADIGM

  • Procedural Programming:

    • Also classified under the imperative paradigm.

    • Allows splitting instructions into procedures or routines.

    • Procedures vs Functions:

    • Procedures do not return values.

    • Functions return a value.

WHAT IS OBJECT-ORIENTED PROGRAMMING?

  • Definition:

    • A computer programming model that organizes software design around data (objects) instead of functions and logic.

    • Relies on the concepts of classes and objects.

STRUCTURE OF OBJECT-ORIENTED PROGRAMMING

  • Classes:

    • User-defined data types serving as blueprints for individual objects.

    • Define attributes and methods.

  • Objects:

    • Instances of a class created with specifically defined data.

  • Methods:

    • Functions inside a class describing behaviors of an object.

  • Attributes:

    • Represent the state of an object, defined in the class template.

OBJECT-ORIENTED PROGRAMMING PRINCIPLES

  • Object-oriented programming is founded on four core principles:

    1. Abstraction:

    • Objects reveal only internal mechanisms relevant to usage, hiding unnecessary implementation details.

    1. Encapsulation:

    • All essential information is contained within an object, with only select information exposed.

    1. Inheritance:

    • Classes can inherit and reuse the code of other classes.

    • Supports relationships and subclasses to reuse common logic while maintaining a unique hierarchy.

    1. Polymorphism:

    • Different objects can respond differently to the same message.

    • Allows defining one or more methods with the same name across different classes.

OBJECT-ORIENTED PROGRAMMING LANGUAGES

  • Pioneering Language:

    • Simula is recognized as the first object-oriented programming language.

  • Popular Pure OOP Languages:

    • Ruby

    • Scala

    • JADE

    • Emerald

  • Languages Primarily Designed for OOP:

    • Java

    • Python

    • C++

  • Languages that Support OOP:

    • Visual Basic .NET

    • PHP

    • JavaScript

BENEFITS OF OBJECT-ORIENTED PROGRAMMING

  • Provides several advantages, including:

    1. Modularity:

    • Code can be organized into separate modules.

    1. Productivity:

    • Enhances developer efficiency.

    1. Reusability:

    • Encourages reuse of existing code in new applications.

    1. Upgradability and Scalability:

    • Code can be easily modified to adapt to changes or to scale with user demands.

    1. Interface Descriptions:

    • Well-defined interfaces improve code interaction.

    1. Security:

    • Easily manage data access and security.

    1. Flexibility:

    • Allows for easier maintenance and change management.