An Overview of Visual Basic .NET
Download
Report
Transcript An Overview of Visual Basic .NET
An Overview of Visual Basic .NET
Overview-An Overview of Visual Basic .NET
1
Visual Basic .NET Environment
Overview-An Overview of Visual Basic .NET
2
Visual Basic .NET Program
Overview-An Overview of Visual Basic .NET
3
A Brief History
of Programming Languages
Computers still rely on human beings to give
them directions
These directions are called programs, and the
people who write the programs are called
programmers
Just as human beings communicate with each
other through the use of languages such as
English, Spanish, Hindi, and Chinese,
programmers use a variety of special languages,
called programming languages, to communicate
with the computer
Overview-An Overview of Visual Basic .NET
4
Machine Languages – Remember ICT?
Within a computer, data are represented by
microscopic electronic switches that can be
either off or on
The off switch is designated by a 0
The on switch is designated by a 1
Instructions written in 0s and 1s are called
machine language or machine code
Machine languages represent the only way to
communicate directly with the computer
Overview-An Overview of Visual Basic .NET
5
Assembly Languages - slightly more advanced
• Assembly languages simplify the programmer’s
job by allowing the programmer to use
mnemonics which are converted into machine
code—the 0s and 1s the computer can
understand
• Mnemonics are memory aids—in this case,
alphabetic abbreviations for instructions
• Programs written in an assembly language
require an assembler
Overview-An Overview of Visual Basic .NET
6
High-Level Languages – the next step up
High-level languages allow the programmer to
use instructions that more closely resemble the
English language
Programs written in a high-level language require
either an interpreter or a compiler to convert the
instructions into 0s and 1s
Like assemblers, both interpreters and compilers
are separate programs
Overview-An Overview of Visual Basic .NET
7
Interpreters vs. Compilers
An interpreter translates the high-level
instructions into machine code, line by line, as
the program is running
A compiler translates the entire program into
machine code before running the program
Overview-An Overview of Visual Basic .NET
8
Procedure-Oriented
High-Level Languages
The programmer determines and controls the
order in which the computer processes the
instructions
Examples include:
BASIC (Beginner’s All-Purpose Symbolic
Instruction Code)
C
Some of the procedure-oriented high-level
languages—for example, the BASIC language—
do not require a great amount of technical
expertise to write simple programs
Overview-An Overview of Visual Basic .NET
9
The Introduction of Windows
Windows software provides an easy-to-use
graphical user interface (GUI)
Although the standard interface found in all
Windows applications makes the user’s life much
easier, it complicates the programmer’s life a
great deal - it could take countless hours to write
instructions creating buttons, scroll bars, and
menus for all Windows applications
Overview-An Overview of Visual Basic .NET
10
Object-Oriented/Event-Driven
High-Level Languages – windows programming
In object-oriented/event-driven languages, the
emphasis of a program is on the objects included
in the user interface (such as scroll bars and
buttons) and the events (such as scrolling and
clicking) that occur when those objects are used
The ability to use objects that model things found
in the real world makes problem solving much
easier
Overview-An Overview of Visual Basic .NET
11
Visual Basic
Visual Basic .NET is an object-oriented/eventdriven programming language that is easy
enough for a nonprogrammer to use, yet
sophisticated enough to be used by professional
programmers
With Visual Basic it takes just a few clicks of the
mouse to include standard Windows objects such
as buttons, list boxes, scroll bars, and icons in
your Windows application
Overview-An Overview of Visual Basic .NET
12
Blueprint of a Basic Watch – Basic Watch Class
Attributes (Data)
Brand
Model number
Dial
Hour hand
Minute hand
Movement
Overview-An Overview of Visual Basic .NET
Behaviors
Track time
Track date
Illuminate dial
13
Blueprint of a Basic Watch with Alarm
Attributes (Data)
Basic Watch attributes
Alarm
Overview-An Overview of Visual Basic .NET
Behaviors
Basic Watch behaviors
Ring alarm
14
Now you try …
Blueprint of a Dog – Dog Class
Attributes (Data)
Overview-An Overview of Visual Basic .NET
Behaviors
15
OOP Terminology
OOP is an acronym for object-oriented
programming
It means that you are using an object-oriented
language to create a program that contains one or
more objects
OOD is an acronym for object-oriented design
Like top-down design, which is used to plan
procedure-oriented programs, OOD is also a
design methodology, but it is used to plan objectoriented programs by dividing a problem into one
or more objects
Overview-An Overview of Visual Basic .NET
16
Object
Examples: menus, radio buttons, and buttons
included in most Windows programs
An Object:
Is anything that can be seen or touched
Has attributes that describe it - characteristics
Has behaviors that the object can either
perform or have performed on it - actions
Overview-An Overview of Visual Basic .NET
17
OOP Terminology
A class is a pattern or blueprint used to create an
object (every object in OOP comes from a class )
A class contains—or, in OOP terms, it
encapsulates—all of the attributes and behaviors
that describe the object the class creates
Objects created from a class are referred to as
instances of the class, and are said to be
“instantiated” from the class
Abstraction refers to the hiding of the internal
details of an object from the user which helps
prevent the user from making inadvertent
changes to the object
Overview-An Overview of Visual Basic .NET
18
More OOP Terminology
Inheritance
Examples: a particular type of watch or dog
Allows you to create one class from another
class
The new class is called the derived class
inheriting all attributes and behaviors of the
original class
The original class is called the base class
Polymorphism is the object-oriented feature that
allows the same instruction to be carried out
differently depending on the object
Overview-An Overview of Visual Basic .NET
19