How to use Inheritance in Application Development

Опубликовано: 05 Ноябрь 2024
на канале: Dot Net Tutorials
250
5

How to use Inheritances in Application Development
In this video, I am going to discuss How to use Inheritance in Application Development with an Example using C# Language.

What is Inheritance?
The process of creating a new class from an existing class such that the new class acquires all the properties and behaviors of the existing class is called inheritance. The properties (or behaviors) are transferred from which class is called the superclass or parent class or base class whereas the class which derives the properties or behaviors from the superclass is known as a subclass or child class or derived class. In simple words, inheritance means to take something that is already made (or available).

Inheritance is the concept that is used for code reusability and changeability purpose. Here changeability means overriding the existing functionality or feature of the object or adding more functionality to the object.

How to use Inheritances in Application Development?
Inheritance is something that comes into the picture, not like the middle of a project or the middle of application development. This can also come middle of the project development but generally when we start application development, in the initial stages only we plan inheritance and implement it in our project.

What is an Entity?
In DBMS terminology what is an Entity? An Entity is something that is associated with a set of attributes. An Entity can be a living or non-living object. But anything that is associated with a set of attributes is called Entity.

Remember, when we are going to develop an application, our application mainly deals with these Entities. Suppose, you are developing an application for a Bank. So, the Entity associated with the bank is a customer. A customer is an Entity. You are developing an application for a school; the Student will be the Entity. Suppose, you are developing an application for a business, then Employee is an entity. So, every application that we develop is associated with a set of entities.

Can we call a phone an Entity? Yes, we can call a phone an entity. It’s not a living object but it can be called an entity. It has some attributes such as Company that manufacture the phone, the model number, the price, the size, the weight, etc.

A student is a living Entity. All students have some attributes such as Id, Name, Address, Phone number, and the class in which the student studies.

An employee is a living Entity. Employees have some attributes such as Employee number, name, job, department, Salary, etc.

The text document of this video: https://dotnettutorials.net/lesson/ho...