COMPUTER SCIENCE DEPARTMENT
Windows Programing
Title: Object Oriented Programming Parts of VB.NET
Name: Fikir Kindu
Section: N1/13
ID: uu87943
Object-Oriented Programming (OOP) in VB.NET
It is a programming paradigm based on the concept of "objects," which are instances of classes. In OOP, we define
classes that encapsulate data (properties) and behavior (methods), which can then be used to create objects.
It is a programming paradigm based on the concept of objects,which can contain data and code.
data in the form of fields (often known as attributes or properties)
code in the form of procedures (often known as methods)
Object-oriented programming uses objects, but not all of the associated techniques and structures are supported
directly in languages that claim to support OOP.
2
Object oriented programming parts
Object
An object is an instance of a class
An object is a data structure or abstract data type containing fields (state variables containing data) and methods.
Objects can contain other objects in their instance variables; this is known as object composition.
Objects sometimes correspond to things found in the real world.
Class
A class is a blueprint for creating objects
A class is simply an abstract model used to define new data types. A class may contain any combination of encapsulated
data (fields or member variables), operations that can be performed on the data (methods) and accessors to data
(properties)
3
In object-oriented programming, a class is a template definition of the methods and variables in a particular
kind of object.
A class may use a set of interfaces to specify collections of operations it provides to its environment.
A class is a user-defined type that describes what a certain type of object will look like.
A class description consists of a declaration and a definition.
Abstraction
Abstraction means displaying only basic information and hiding the details.
Data abstraction refers to providing only necessary information about the data to the outside world, hiding
the background info or implementation.
Advantages
Better communication among team members with a high-level view of objects.
It helps manage and understand complex systems more efficiently.
4
Encapsulation
Encapsulation is defined as wrapping up of Data and Information under a single unit.
Encapsulation is binding together the data and the functions that manipulate them.
Encapsulation also leads to data abstraction or hiding. Using Encapsulation also hides the data
Encapsulation hides the class's internal implementation details and provides a clean and controlled
interface for interacting with the object.
Advantages
Data hiding for security and integrity.
Easier maintenance and troubleshooting.
Reusability of code in different parts of the program.
5
Inheritance
Inheritance is the process in which two classes have a relationship with each other, and objects of one class
acquire properties and features of the other class.
The class which inherits the features is known as the child class, and the class whose features it inherited is
called the parent class.
It enables the creation of new classes that reuse features from existing classes.
Advantage
Code reusability by inheriting properties and behaviors from a base class.
The organized hierarchical relationship between classes.
Reduces redundancy and promotes a consistent codebase.
It saves time and effort by building on existing code.
6
Polymorphism
The word polymorphism means having many forms. It is the ability to take more than one form.
It is a feature that provides a function or an operator with more than one definition.
It can be implemented using function overloading, operator overload, function overriding, virtual function.
An operation may show off different behaviors at different times.
Advantages
Flexibility and extensibility by adding new classes without modifying existing code.
Simplifies code by using a common interface for different data types.
Improves code readability and maintainability.
It allows you to treat different objects similarly, even if they work differently internally.
It provides flexibility, which makes your code more adaptable to changes in different situations.