Managing Information Technology

(Frankie) #1
Chapter 2 • Computer Systems 51

transactions, they all have the following things in
common:

1.All Web applications are based on an n-tier architec-
ture (where ). The typical system consists of
three tiers: a user interface (client), a Web or applica-
tion server, and a database server.
2.The user interacts with the system (on his or her ma-
chine) through Web-based forms. Data entered into
the forms are sent to the server, where a server appli-
cation program processes them. This program might
write parts of this information to a database (residing
on a different machine).

The most common user interface encountered by
users is an HTML form. This form might be either static
or dynamic (i.e., produced by a program). Languages used
to produce the form might run on the server side
(e.g., PHP) or the client side (e.g., JavaScript). Often

nÚ 2

public class AnimalTest
{
public static void main(String args[])
{
Animal myanimal;

myanimal = new Dog("10.5", 30,"Black");
myanimal.display();
}
}

FIGURE 2.13 Java Instantiation of a New Dog


public class Dog{
double height;
double weight;
String color;

public Dog (double someheight, double someweight, String somecolor)
{
height = sometype;
weight = someweight;
color = somecolor;
}

//methods
public void sleep() {
//code to make a dog sleep will go here
}
public void run() {
//code to make a dog run will go here
}

public Object fetch() {
//code to make a dog fetch will go here
//this method will return the item fetched
}
public void display()
{
System.out.println("The Height of Animal is: " + height);
System.out.println("The Weight of Animal is: " + weight);
System.out.println("The Color of the Animal is: " + color);
}
}

FIGURE 2.12 Java Class Called Dog

Languages for Developing Web Applications


Although Web-based applications range in complexity
from very simple applications that allow user regis-
tration to applications that enable business-to-business

Free download pdf