4201. Object-Oriented
Programming in Visual Basic
Rev. 4.0
.NET is a revolutionary advance in programming technology that
greatly simplifies application development. Microsoft’s popular Visual Basic
programming language has been upgraded to take advantage of the new .NET
features. Visual Basic has become a fully object-oriented programming language
with capabilities comparable to C++, Java, and Microsoft’s new language C#.
This course is a practical introduction to programming in Visual
Basic and the use of services provided by .NET. It emphasizes the Visual Basic
language and how to build Visual Basic applications from an object-oriented
perspective. Knowledge of the earlier version of the language, Visual Basic 6,
is not required. It is current to Visual Studio 2010 and .NET 4.0, which
continues the introduction of new features in the language, making Visual Basic
increasingly parallel to C#.
One of the strengths of Visual Basic, and the reason it has enjoyed
such widespread use, is the ease with which Windows application can be
developed. Microsoft has revamped the way that Windows applications are built
under .NET. Windows Forms, used by .NET languages, represents a class library
that brings uniformity to the components of a Windows application. The course
includes substantial coverage of using Windows Forms in Visual Basic, including
creating database applications with ADO.NET.
The first part of the course covers the fundamentals of Microsoft’s Visual
Basic programming language. It starts with a brief chapter, “.NET: What You Need To Know,” which gets you up and
running in the .NET environment with a minimum of fuss. The next five chapters
cover the Visual Basic language essentials.
The second part of the course discusses object-oriented programming in
Visual Basic. It contains three chapters that focus on developing classes using
Visual Basic and then extending them via Visual Basic’s inheritance capabilities.
Interface-based programming and collection classes are also introduced.
The final part of the course introduces Windows Forms. Programmers
familiar with previous versions of VB will notice that this significantly
changes the programming model, yet also introduces flexibility not previously
available. The chapters in this part evolve from building simple form-based
applications to ones with dialogs and menus. It includes an introduction to
database programming using ADO.NET. The course concludes with a chapter
covering the newer features in Visual Basic. An appendix provides a tutorial on
Visual Studio 2010.
The course is practical, with many example programs and a
progressively developed case study. The student will receive a comprehensive
set of materials, including course notes and all the programming examples.
LEARNING OBJECTIVES
·
Gain an understanding of the .NET architecture
·
Gain a working knowledge of the Visual Basic
programming language
·
Learn how to build object-oriented applications
using Visual Basic
·
Learn how to implement Windows desktop applications
using Windows Forms, including programs that interact with databases
·
Gain a working knowledge of auto-implemented
properties, local type inference, object initializers, anonymous types,
extension methods, collection initializers, LINQ, and other newer features in
Visual Basic
Course Duration: 5
days
Prerequisites: The
student should have some programming experience.
1.
.NET: What You Need To Know
.NET Executables and the CLR
A .NET Testbed for Visual Basic Programming
Visual Studio 2010
2.
Fundamentals of Visual Basic Programming
Program Structure
Namespaces
Data Types
Variables
Conversions
Operators and Expressions
Console I/O
3.
Control Structures
If Statement
Select Case Statement
Do/Loop Statement
For/Next Statement
Exit and Continue
4.
Procedures
Subroutines
Functions
Pass-by-value Versus Pass-by-reference
Access modifiers
Overloading
Optional Parameters
5.
Advanced Data Types
Arrays
Enumerations
Structures
6.
Exception Handling
Error Detection
Exception Handling
7.
Object-Oriented Programming
Object-Oriented Concepts
Defining Classes
Methods and Properties
Auto-Implemented Properties
Shared Data and Methods
Constructors
8.
Inheritance
Inheritance
Controlling Base Class Construction
Access Control
Polymorphism
Events
Abstract and Not Inheritable Classes
Type Conversion in Inheritance
9.
Interfaces and Collections
Interface Fundamentals
Programming with Interfaces
Using Interfaces at Runtime
Resolving Ambiguities
Collections
Generic Types
Type-Safe Collections
10. Introduction
to Windows Forms
Creating Windows Applications Using Visual Studio 2010
Partial Classes
Handling Events
Common Controls
11. Windows
Forms Controls
Buttons, Labels and Textboxes
Radio Buttons and Group Boxes
Check Boxes
List Boxes and Combo Boxes
Timer Control
Flexible Event Handling
12. User
Interface Features
Message Boxes
Custom Dialogs
Modeless Dialogs
Common Dialogs
Menus
Context Menus
13. Database
Programming
ADO.NET
.NET Data Providers
Using Data Readers
Using Data Sets
Data Binding
14. Newer
Features in Visual Basic
Local Type Inference
Object Initializers
Array Initializers
Anonymous Types
Partial Methods
Extension Methods
Collection Initializers
Variance in Generic Interfaces
Language Integrated Query (LINQ)
Appendix A. Using Visual
Studio 2010
Overview of Visual Studio 2010
Creating a Console Application
Project Configurations
Debugging
Multiple-Project Solutions
Appendix B. Learning
Resources
System Requirements
Course exercises require Microsoft Visual Studio 2010 and a Windows
operating system, XP or more recent. See the appropriate course Setup Guide for
details.
A good minimal hardware profile for this course consists of a 2 GHz
or better CPU, 1 GB of RAM, and at least 4 GB of free disk space for tools
installation and courseware.