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
- 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()
- Classes:
- Templates or blueprintsà define the
properties and methodsà used for creating objects.
- Encapsulation:
- Concept of bundling data and the
methodsà that operate on
that data into a single unit, i.e., a class.
- 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.
- Polymorphism:
- Different objects respond to the
same method or function call in different ways.
- Multiple features work by one
method name.
- 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.
- 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
- Modularity:
- Reusability:
- Scalability:
- Maintainability:
- Real-World
Modelling:
- Security:
Disadvantages of
Object-Oriented Systems
- Complexity:
- For beginners, due to concepts like
classes, inheritance, and polymorphism, etc.
- Performance
Overhead:
- additional memory and processing
overhead à due to
object creation, inheritance, and method calls.
- Longer
Development Time:
- especially for large and complex
systems.
- Overhead
of Abstraction:
- increased complexity à make the
code harder to maintain or understand.
Examples
- Java:
- C++:
- Python:
- C#:
- Ruby:
======================================================
0 Comments