DFP4013
VISUAL PROGRAMMING
CHAPTER 1 INTRODUCTION TO VB.NET PROGRAMMING
Course Learning Outcome
CLO 1. Explain the different elements
of a visual programming language,
architecture, IDE, object oriented
programming techniques and the
concepts as building blocks to
develop correct, coherent programs.
Learning Outcome
Overview of Visual Basic Understand Visual Basic .NET
Discuss the history of Visual Basic environment.
and .NET. Describe the event driven
Identify the .NET framework elements: programming concept in Visual
a. Windows Applications Basic .NET.
b. Web Applications Navigate the Integrated
c. NET Framework Class Library Development Environment (IDE)
d. Common Language Runtime (CLR) and Help features.
Identify the Visual Basic .NET Identify the Visual Basic .Net
application types: Integrated Development
a. Windows Environment (IDE) Windows
b. Web components:
c. Console a. Solution Explorer
d. Windows Services b. Toolbox
e. Web Services c. Properties
f. Components d. Output
Introduction
What is .NET??
Software platform
In other words:
.NET is not a language (Runtime and a library for writing
and executing written programs in any compliant
language)
Introduction
Visual Basic .NET support in Visual Studio .NET, with
project templates, designers, and other features of the
development environment.
Visual Basic .NET has many improved language
features, such as inheritance, interfaces, and
overloading that make it a powerful object-oriented
programming language.
VB.NET support multithreading and exception
handling.
What is .Net Framework
• Runs primarily on Microsoft Windows.
• Includes a large library and supports several programming
languages.
• Programs written for the .NET Framework execute in a software
environment, known as the Common Language Runtime (CLR)
• Provides user interface, data access, database connectivity, web
application development and network communications.
.Net History
.NET Framework (pronounced dot net)
Microsoft started development on the .NET Framework
in the late 1990s originally under the name of Next
Generation Windows Services (NGWS). By late 2000
the first beta versions of .NET 1.0 were released.
Version 3.0 of the .NET Framework is included with
Windows Server 2008 and Windows Vista.
Version 3.5 is included with Windows 7, and can also be
installed on Windows XP.
On 12 April 2010, .NET Framework 4 was released
alongside Visual Studio 2010.
Architecture of .NET Framework
1) Common Language Specification/Infrastructure
2) Assemblies
3) Metadata
4) Security
5) Class Library
6) Memory management
7) Common Language Runtime
Architecture of .NET Framework
Key Points
1) The CLR environment is a managed environment.
2) The .Net framework provides a choice of development
languages.
3) The .Net framework class library implements the .Net
framework.
Common Language Insfrastructure
Common Language Infrastructure (CLI)
Enables an application program written in any of several
commonly-used programming languages .
Common Language Infrastructure has been accepted as an open
standard by ECMA, an international organization for the
promotion of technology standards.
Common Language Infrastructure specifies:
• A common set of data types that any language must support (the
Common Type System - CTS)
• An introduction to the component structure
• How the machine state is managed
• How exceptions are handled
Assemblies
An assembly in the Common Language Infrastructure (CLI) is a
compiled code library used for deployment, versioning, and
security.
It is provides:
-> a fundamental unit of physical code grouping.
-> a fundamental unit of logical code grouping.
There are two types:
1. process assemblies (EXE)
2. library assemblies (DLL).
An assembly is the .NET name for an executable file. In other
words, a .NET assembly is just the .EXE or .DLL file that is the end
result of your program.
Metadata
Metadata is binary information describing your
program that is stored either in a common language
runtime portable executable (PE) file or in memory.
Metadata stores the following information:
1. Description of the assembly.
Identity (name, version, culture, public key).
The types that are exported.
Other assemblies that this assembly depends on.
Security permissions needed to run.
2. Description of types.
Name, visibility, base class, and interfaces implemented.
Members (methods, fields, properties, events, nested types).
3. Attributes.
Additional descriptive elements that modify types and
members.
Security
The .NET Framework provides several mechanisms for
protecting resources and code from unauthorized code and
users:
Code access security uses permissions to help limit the
access that code has to protected resources and operations.
It helps protect computer systems from malicious mobile
code and helps provide a way to allow mobile code to run
safely.
Role-based security provides information needed to make
decisions about what a user is allowed to do. These
decisions can be based on either the user's identity or role
membership, or both.
Class Library
Unified Classes
Web Classes (ASP.NET)
Controls, Caching, Security, Session, Configuration etc
Data (ADO.NET) Windows Forms
ADO, SQL,Types etc Design, Cmpnt Model etc
XML Classes Drawing Classes
XSLT, Path, Serialization etc Drawing, Imaging, Text, etc
System Classes
Collections, Diagnostics, Globalization, IO, Security,
Threading Serialization, Reflection, Messaging etc
Class Library
The .NET Framework includes classes, interfaces and value
types that optimize the development process and provide access
to system functionality.
The .NET Framework types are the foundation on which .NET
applications, components, and controls are built. The .NET
Framework includes types that perform the following
functions:
Represent base data types and exceptions.
Encapsulate data structures.
Perform I/O.
Access information about loaded types.
Invoke .NET Framework security checks.
Provide data access, rich client-side GUI, and server-
controlled, client-side GUI.
Memory Management
Microsoft .NET framework memory management
is taken care of by the Common Language
Runtime (CLR) system.
To allocate and free up the memory.
Microsoft .NET framework memory management
system consists of a garbage collector that runs
on periodical basis on a different thread from the
application's thread, which specifies all the
unusable objects and get back the memory
allocated to them.
Common Language Runtime
CLR works like a virtual machine in executing all
languages.
All .NET languages must obey the rules and
standards imposed by CLR.
Examples:
Object declaration, creation and use
Data types, language libraries
Error and exception handling
Interactive Development Environment (IDE)
Advantages of Visual Studio.NET
IntelliSense
Help about the code usage, keep track of the parameters, and add
calls to properties and methods with only a few keystrokes, Eg; List
Members, Parameter Info, Quick Info, and Complete Word.
Data Binding
.Net provides a simple way to display and interact with data.
Support multiple language
Since CLR works like a virtual machine in executing all common
languages (refer previous slide). A code can call or use a function
written in another language. Eg; VB.NET, C#, COBOL, Perl and etc.
Integrated Development Environment (IDE)
Also known as integrated design
environment and integrated debugging
environment.
Is a type of computer software that
assists computer programmers to
develop software.
In the case of Visual Basic .NET, that
IDE is Visual Studio.
Integrated Development Environment (IDE)
The Visual Studio IDE consists of
several sections, or tools, that the
developer uses while programming
which are:
1. The Toolbox on the left
2. The Solution Explorer and
Properties Windows on the right
3. The Code / Design view in the
middle
Integrated Development Environment (IDE)
Design view
Integrated Development Environment (IDE)
Code view
Integrated Development Environment (IDE)
Toolbox
is a palette of developer objects, or
controls, that are placed on forms or
web pages and then code is added to
allow the user to interact with them.
An example would be TextBox, Button
and ListBox controls. With these three
controls added to a Windows Form
object the developer could write code
that would take text, input by the
application user, and added to the
ListBox after the button was clicked.
Integrated Development Environment (IDE)
Solution Explorer
This is a section that is used to view
and modify the contents of the project.
A Visual Studio Windows Application
Project will generally have a Form
object with a code page, references to
System components and possibly other
modules with special code that is used
by the application.
Integrated Development Environment (IDE)
Properties Windows
The properties windows shows all the
control (like textbox) properties to be
change at design time.
Most of this properties can be change
at run time with some code, but
basically most of this properties
change the way the control is display
on your application.
Integrated Development Environment (IDE)
Design view
Forms are designed graphically. In other words, the developer has
a form on the screen that can be sized and modified to look the
way it will be displayed to the application users called design
view.
Integrated Development Environment (IDE)
Code view
This center window of the IDE is also where developers
write the code that makes everything in the application work
called code view.
Getting Stated with .Net
thank you