CHAPTER ELEVEN Using Visual Basic .NET to Create Web Applications – Pemrograman Visual

advertisement
Matakuliah
Tahun
: T0063 – Pemrograman Visual
: 2009
Using Visual Basic .NET to Create Web
Applications
CHAPTER ELEVEN
Introduction
• We will look at applications where various parts of the
application run on the client as well as servers.
• Visual Basic .NET has a powerful set of Web Application
tools.
• This is made possible using Microsoft’s ASP.NET
technology.
• Different Web architectures are examined.
Bina Nusantara University
2
Introduction (cont.)
• An application is divided into three primary functions:
– Presentation (GUI).
– Processing business logic.
– Data management.
• We will look at data validation.
• We will examine processing databases in the Web
Application context.
Bina Nusantara University
3
Introduction (cont.)
• The chapter is ended with a project that demonstrates
how two or more Web pages can communicate with
each other by sharing data.
Bina Nusantara University
4
Objectives
• Explain the various functions of a typical Web
Application.
• Explain what is meant by “client/server.”
• Explain how the client/server architecture can be
implemented in a number of different ways.
• Discuss the trade-offs associated with various
client/server architecture options.
Bina Nusantara University
5
Objectives (cont.)
• Build a Web Application using the tools available with
Visual Basic .NET.
• Validate user data using the Validation controls
supported by Visual Basic .NET.
• Use the Web Form DataGrid control to display a data set
and to edit and update a database.
• Use XSLT documents to transform XML into HTML on
the server to then be displayed on the client.
Bina Nusantara University
6
An Introduction to Functional Web
Architectures
• It is useful to break an application down into three
primary functions:
– Presentation involves how the application interacts
with the user.
– Business Logic involves rules that define how the
application handles data and processes them.
– Data Management involves databases and software
to management these databases.
Bina Nusantara University
7
An Introduction to Functional Web
Architectures (cont.)
• Architecture refers to how these three functions are
allocated to various computers.
• Client refers to the computer (or other intelligent device)
that the user is using.
• Server refers to another computer that is distinct from
the client and may be located anywhere in the world.
– One server is referred to as two-tier architecture.
– More than two servers are referred to as n-tier
architecture.
Bina Nusantara University
8
An Introduction to Functional Web
Architectures (cont.)
• Presentation
– Option 1: Pure HTML.
• Any changes seen on the browser need to be sent
to the browser from the Web server.
• This option is unacceptable.
– Option 2: Script Within the Browser.
• Script are embedded within the HTML code sent
from the server to the browser.
• Creates very powerful user interfaces.
Bina Nusantara University
9
An Introduction to Functional Web
Architectures (cont.)
• Business Logic
– Option 1: All Client.
• The application runs exclusively on the client
computer.
• Low bandwidth requirement.
• For medium and large organizations, problems
involve software installation and maintenance.
• Limited use.
Bina Nusantara University
10
An Introduction to Functional Web
Architectures (cont.)
– Option 2: Embed Business Logic in a Web Page
Using Client-Side Scripting.
• Uses scripts that are interpreted in the browser.
• Scripts process business logic.
• Overcomes the installation and maintenance
problems of Option 1.
• Problem with user ability to view the scripts.
Bina Nusantara University
11
An Introduction to Functional Web
Architectures (cont.)
– Option 3: Embed a Client-Side Component in the
Web Page.
• A software component, not script, is embedded in
the Web page and downloaded.
• Shares the advantages of Option 2.
• Overcomes the problem of script visibility.
• Requires large bandwidth.
• Security is a major problem.
• Microsoft uses a trusted application model.
Bina Nusantara University
12
An Introduction to Functional Web
Architectures (cont.)
– Option 4: Process Business Logic on the Server.
• Business logic is processed on the server.
• Communication between a Web server and client
browser.
• Implemented using Active Server Pages (ASP).
• Includes all the advantages of Option 3 without the
disadvantages of potential large bandwidth and
trusted application issues.
Bina Nusantara University
13
An Introduction to Functional Web
Architectures (cont.)
• Data Management
– Option 1: Client-Side Only.
• Database and database management system are
both on the client.
• Speed is the advantage.
• No network issues.
• No issues with multiple users.
• Problems with database consistency, installation,
and maintenance.
Bina Nusantara University
14
An Introduction to Functional Web
Architectures (cont.)
– Option 2: Server-Side Only.
• Database and DBMS are both on the server.
• Problem with communicating requests to the
server.
Bina Nusantara University
15
An Introduction to Functional Web
Architectures (cont.)
– Option 3: Send a Set of Records to Client for Further
Processing.
• Similar to Option 2.
• Data from the server is processed directly by the
browser.
Bina Nusantara University
16
Download