Explain Object Oriented Programming in VB.NET

In this article you will learn Object-Oriented Programming in Visual Basic.
  • 18913

Visual Basic is object-Based, which means it is a Object-Oriented Programming Language. Visual Basic .Net supports all features of OOP like Abstraction, Encapsulation, Polymorphism and Inheritance. It is important to have the brief overview of OOP before starting OOP with Visual Basic.

What is Object-Oriented programming?

Object oriented programming is a concept that was created because of the need to overcome the problems that were found with using structured programming techniques. While structured programming uses an approach which is top down, OOP uses an approach which is bottom up.

Traditionally, programming has placed an emphasis on logic and actions.Object oriented programming has taken a completely different direction,and will place an emphasis on objects and information. With object oriented programming, a problem will be broken down into a number of units. These units are called objects. The foundation of OOP is the fact that it will place an emphasis on objects and classes. In Object-Oriented programming a program is divided into object and these object can communicate with each other through functions.

Concepts of OOP:

  • Objects

  • Classes

  • Data Abstraction

  • Encapsulation

  • Polymorphism

  • Inheritance

Objects

Object is the basic unit of object-oriented programming. Objects are identified by its unique name. An object represents a particular instance of a class. There can be more than one instance of an object. Each instance of an object can hold its own relevant data. An Object is a collection of data members and associated member functions also known as methods. When a program is executed, objects interact with each other by sending messages.

More can be found at here.

Classes 

Classes are data types based on which objects are created. Objects with similar properties and methods are grouped together to form a Class. Thus a Class represent a set of individual objects. Characteristics of an object are represented in a class as Properties. The actions that can be performed by objects becomes functions of the class and is referred to as Methods.

More can be found at here.

Data Abstraction

Data Abstraction increases the power of programming language by creating user defined data types. Data Abstraction also represents the needed information in the program without presenting the details. Classes use the concept of abstraction and are defined as a list of abstract attributes.

Encapsulation

Data Encapsulation combines data and functions into a single unit called Class. When using Data Encapsulation, data is not accessed directly; it is only accessible through the functions present inside the class. Data Encapsulation enables the important concept of data hiding possible.

Polymorphism

Poly means many and morph means form. Thus, polymorphism refers to being able to use many forms of a type without regard to the details. It is the characteristic of being able to assign a different meaning specifically, to allow an entity such as a variable, a function, or an object to have more than one form. In Polymorphism objects behaves differently depending on their data types.

More can be found at here

Inheritance

Inheritance is the process of forming a new class from an existing class or base class. The base class is also known as parent class or super class, The new class that is formed is called derived class. Derived class is also known as a child class or sub class. Inheritance helps in reducing the overall code size of the program, which is an important concept in object-oriented programming.

More can be found at here

Advantages of Object-Oriented Programming: 

  • Object-Oriented Programming provides a clear modular structure for programs which makes it good for defining abstract data types where implementation details are hidden and the unit has a clearly defined interface.
  • Object-Oriented Programming makes it easy to maintain and modify existing code as new objects can be created with small differences to existing ones.
  • Object-Oriented Programming provides a good framework for code libraries where supplied software components can be easily adapted and modified by the programmer. This is particularly useful for developing graphical user interfaces.

Summary

Hope this article help you to learn Object-Oriented Programming in Visual Basic.

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.