Code The major characteristics of oops are re usability and ease of usage. The ideas of oops include inheritance, abstraction, polymorphism, encapsulation, etc.
According to Richard Gabriel, abstraction is "the process of identifying common patterns that have systematic variations; an abstraction represents the common pattern and provides a way to specify which variation to use."
A parent class that permits inheritance but never allows for instantiation is known as an abstract class. One or more abstract methods from abstract classes don't have implementations. Inherited classes can specialize thanks to abstract classes.
/// C#
using System;
namespace AbstractionSample
{
public abstract class Bank
{
private float _account;
private float _amount;
public float Account
{
get
{
return _account;
}
set
{
_account= value;
}
}
public float Amount
{
get
{
return _amount;
}
set
{
_amount= value;
}
}
public abstract void CalculateAccount();
public abstract void CalculateAmount();
}
}
We can say in real time words,
Abstraction is the process of identifying and concentrating on a situation's or item's crucial attributes while excluding/filtering out the undesirable characteristics of that situation or object.Take a person as an example, then examine how that person is represented abstractly in various contexts.
* A doctor views the individual as a patient (abstract). The doctor is curious about a patient's name, height, weight, age, blood type, previous or present illnesses, etc.
* An employer views a person as an employee (abstract). Employers are interested in a person's name, age, health, educational background, employment history, etc.
You can see that the foundation of software development is abstraction. We can only define the fundamental components of a system through abstraction. Modelling (or object modelling) is the process of determining the abstractions for a certain system.
Comments
Post a Comment