You are on page 1of 41

Chapter 1

Introduction to Application Development

Content
1.1 Definition of Application. 1.2 Application Development Process. 1.3 Different Types of Application Development Tools. 1.4 Introduction to Visual Basic.NET. 1.5 The Visual Studio Environment

Introduction to VB.NET

1.1 Definition of Application

also called end-user programs includes database programs, word processors, and spreadsheets. applications software sits on top of systems software because it is unable to run without the operating system and system utilities.
Introduction to VB.NET 3

1.2 Application Development Process

Performing a Task on the Computer


Determine Output Identify Input Determine process necessary to turn given Input into desired Output

Program Planning Program Development Cycle


Introduction to VB.NET 4

Problem-solving: approach like algebra class

How fast is a car traveling if it goes 50 miles in 2 hours? Output: a number giving the speed in miles per hour Input: the distance and time the car has traveled Process: speed = distance / time
Introduction to VB.NET 5

Pictorial representation of the problem solving process

Introduction to VB.NET

Program Planning

A recipe is a good example of a plan Ingredients and amounts are determined by what you want to bake Ingredients are input The way you combine them is the processing What is baked is the output Program Planning Tips

Always have a plan before trying to write a program The more complicated the problem, the more complex the plan must be Planning and testing before coding saves time coding
Introduction to VB.NET 7

Program development cycle


Software refers to a collection of instructions for the computer The computer only knows how to do what the programmer tells it to do Therefore, the programmer has to know how to solve problems The Cycle are:

Analyze: Define the problem. Design: Plan the solution to the problem. Choose the interface: Select the objects (text boxes, buttons, etc.). Code: Translate the algorithm into a programming language. Test and debug: Locate and remove any errors in the program. Complete the documentation: Organize all the materials that describe the program.
Introduction to VB.NET 8

Software Development LifeCycle

Waterfall Model in SDLC (Dix. 2004)

Requirements specification Architectural design Detailed design Implementation and Unit Testing Integration and testing Operation and maintenance
Introduction to VB.NET 9

1.3 Different Types of Application Development Tools

Boolean C++ VB 6 ASP - Active Server Pages, a web-scripting interface by Microsoft PHP an open source programming language Dream Viewer Lotus Note Oracle Microsoft Access
Introduction to VB.NET 10

1.4 Introduction to Visual Basic.NET

Windows Graphical User Interface Window = Form Toolbox of elements called Controls

Text Box Label Check Box Button


Introduction to VB.NET 11

Programming Languages

Procedural

Program specifies exact sequence

Event Driven (VB 6.0 and previous) Object Oriented Programming (VB .NET)

User controls sequence


Click event Double Click event Change event


Introduction to VB.NET 12

Visual Studio .NET

Included in Visual Studio .NET

Visual Basic (can also be purchased separately) Visual C++ C# J# .NET Framework
Introduction to VB.NET 13

Visual Studio .NET Editions

Standard Professional Enterprise Developer Enterprise Architect

Visual Basic.NET

An object oriented language Object oriented programming terminology


Introduction to VB.NET 14

Object Oriented Programming Terminology

Object ==> Noun

Form and Controls Color of a Form Move a Form

Property ==> Adjective

Method ==> Verb

Event ==> Occurs when the user takes action

User clicks a button, User moves a form


Each control added is an Instance of a Class
Introduction to VB.NET 15

Class ==> Template to create new object

Dot Notation

Used to reference object's properties and events in code

Object dot Property

Form.Text, TextBox.Text
Form.Hide( ), TextBox.Focus( )

Object dot Event

To reference an object's events use an underscore instead of a dot

Button_Click, ListBox_TextChanged
Introduction to VB.NET 16

Object Oriented Analogy

Class = automobile Properties = make, model, color, year Object = each individual car

Object is also an Instance of the automobile class

Methods = start, stop, speedup, slowdown Events = car arrives, car crashes
Introduction to VB.NET 17

Writing Visual Basic Projects

Planning

Design Interface Plan Properties Plan Code Create Forms and Controls Set Properties Write Code
Introduction to VB.NET 18

Programming

VB Application Files
Open this file directly to work on a Project

One Solution File Solution User Options File Form Files Resource File for the Form Project Files Project User Options File

.sln .suo .vb .resx

.vbproj .vbproj.user

Introduction to VB.NET

19

1.5 The Visual Studio Environment

Integrated Development Environment (IDE) Form Designer Editor for entering code Compiler Debugger Object Browser
Introduction to VB.NET 20

Visual Studio IDE Start Page

Introduction to VB.NET

21

IDE Main Window

Introduction to VB.NET

22

New Project Dialog

Introduction to VB.NET

23

IDE Main Window

Toolbars Document Window Form Designer Solution Explorer Window Properties Window Toolbox
Introduction to VB.NET 24

VB Toolbox

Holds the controls you place on a form

Introduction to VB.NET

25

Visual Studio Help

Extensive Help feature Includes Microsoft Developer Network library (MSDN) Entire reference manual Coding examples

Introduction to VB.NET

26

Modes

Design Time Run Time Break Time


Look at the Title Bar

Introduction to VB.NET

27

Hello World Project Design the User Interface


messageLabel

pushButton

exitButton
Introduction to VB.NET 28

Properties Window-Label1

Rename Label1 to messageLabel

Introduction to VB.NET

29

Set the Properties

Label

Name Text
Name Text Name Text Name Text

messageLabel leave blank


pushButton Push Me exitButton Exit helloForm Hello World by your name
Introduction to VB.NET 30

Button 1

Button 2

Form

Set the Project's Startup Object

The default startup object is Form1 The name of the form should always be changed to adhere to naming rules Click on Project name in Solution Explorer window, choose Project menu, Properties and change the startup object to match the new form name
Introduction to VB.NET 31

Project Property Page Dialog

Introduction to VB.NET

32

Write Code

While the project is running the user can perform actions Each action by the user causes an Event to occur Write code for the events you care about, the events you want to respond to with code Code is written as event procedures VB will ignore events for which you do not write code
Introduction to VB.NET 33

Remark Statement

Also known as Comment, used for documentation Non-executable Automatically colored Green in Editor Begins with an apostrophe ( ' )

On a separate line from executable code At the right end of a line of executable code ' Display the Hello World message.
Introduction to VB.NET 34

Editor Window

Declarations Section Class list Method list

Introduction to VB.NET

35

Assignment Statement

Assigns a value to a property or variable Operates from right to left Enclose text strings in quotation marks (" ")

messageLabel.Text=" Hello World "

Introduction to VB.NET

36

Ending a Program

Execute the Close Method of the Form Methods always have parentheses
(this will help you distinguish them from Properties which never have parentheses)

Current Form may be referenced as Me Me.Close( )


Introduction to VB.NET 37

Test and Debug


Save Project - File Menu, Save All Run Project

Debug Menu, Start Start

(F5)

Start Without Debugging(CTRL F5) Compile errors Run-Time Errors Logic errors Syntax errors

Correct any Errors and Rerun


"Help is always available from the Help Menu or by pressing F1."


Introduction to VB.NET 38

Recommended Naming Conventions for VB Objects


Object Class Form Button TextBox Label Radio Button CheckBox Horizontal ScrollBar Vertical ScrollBar PictureBox ComboBox ListBox Example dataEntryForm exitButton paymentAmountTextBox totalLabel boldRadioButton printSummaryCheckBox rateHorizontalScrollBar temperatureVerticalScrollBar landscapePictureBox bookListComboBox ingredientsListBox Introduction to VB.NET 39

Naming Rules and Conventions

Have a set of standards and always follow them No spaces, punctuation marks or reserved words Use camel casing

Examples

messageLabel exitButton dataEntryForm paymentAmountTextBox


Introduction to VB.NET 40

The End Of
Chapter 1

You might also like