Introduction to Object-Oriented Systems

Introduction to Object-Oriented Systems

·       A software design and development approach.

·       Uses "objects"à represent data and the operations (methods) à operation perform on that data.

·       Modular,

·       Reusable,

·       Easier to design complex applications.

 

Core Concepts or key features of Object-Oriented Systems

  1. Objects:
    • fundamental building blocksà representsà  an instance of a class, à created by the class
    • An object has two primary attributes:
      • State (Attributes/Properties/ data):
      • Behaviour (Methods/Functions):

Example:- car object:

    • State: colour, model, speed, engine status
    • Behaviour: start(), stop(), accelerate()
  1. Classes:
    • Templates or blueprintsà define the properties and methodsà used for creating objects.
  2. Encapsulation:
    • Concept of bundling data and the methodsà that operate on that data into a single unit, i.e., a class.
  3. Inheritance:
    • A mechanism à one class to inherit properties and behaviours from another class.

example:

    • A Vehicle class is a superclass, and a Car class inherit from it.
  1. Polymorphism:
    • Different objects respond to the same method or function call in different ways.
    • Multiple features work by one method name.
  2. Abstraction:
    • A concept à hiding complex implementation details and exposing only the necessary and relevant parts of an object.

7.     Constructors and Destructors:

    • Constructors: Special methods used to initialise objects when they are created.
    • Destructors: Methods that clean up resources when an object is destroyed.
  1. Interfaces and Abstract Classes:
    • Interface: A contract that defines methods that classes must implement, providing a way for unrelated classes to communicate.
    • Abstract Class: A class that cannot be instantiated but provides a common interface for subclasses.

 

Advantages of Object-Oriented Systems

  1. Modularity:
  2. Reusability:
  3. Scalability:
  4. Maintainability:
  5. Real-World Modelling:
  6. Security:

 

Disadvantages of Object-Oriented Systems

  1. Complexity:
    • For beginners, due to concepts like classes, inheritance, and polymorphism, etc.
  2. Performance Overhead:
    • additional memory and processing overhead à due to object creation, inheritance, and method calls.
  3. Longer Development Time:
    • especially for large and complex systems.
  4. Overhead of Abstraction:
    • increased complexity à make the code harder to maintain or understand.

Examples

  1. Java:
  2. C++:
  3. Python:
  4. C#:
  5. Ruby:

====================================================== 

Post a Comment

0 Comments