Bcs-053 Block 2 Unit 1
Bcs-053 Block 2 Unit 1
Client-Server Model
To access websites (WWW) we require the following tools:
1. The first and the foremost is the web address which is a unique address of a resource at a
website on WWW. This resource address is called the Uniform Resource Locator (URL).
2. The second in this context would be a set of rules that allows transfer of the resources from
a website to the user. This set of rules was documented as Hypertext Transfer Protocol
(HTTP).
3. Thirdly, we must agree on some common but simple computer language that allows
consistent publishing of the contents. This common computer language is Hypertext Markup
Language (HTML) which uses standard tags.
In the whole process, the browser at our computer acts as a client. The website has to take the
responsibility to make sure that client gets the requested page, thus, serves the client. Thus,
websites are hosted on a Server which is called the Web Server. The basic Client-Server architecture
is shown below:
…
Client Client Client Client
.
1 2 3 n
The Internet
1
Global Key Technologies-IGNOU BCA-MCA Coaching
Nirman Vihar (Laxmi Nagar Branch), New Delhi-110092
011-47508282, 9999106899 | www.globalkeytechnologies.com
Application Logic Layer / Tier: This is also called the middleware. This layer is primarily responsible
to provide business rules, sharable components of a web application, access control etc. This layer
shields the data layer from direct use of the clients. This layer provides an interface between the
presentation and data layer.
Data Layer/Tier: The data for a web application may be hosted on a database management system.
The data layer controls the integrity of data residing on some data storage system. The application
logic sends queries to data layer which sends back the query results to the application logic layer.
MVC Architecture
This architecture is known as Model-View-
Controller (MVC). This architecture can also be
used for the development of a web application.
The MVC architecture has three functional
component of a web application that
communicates through a user as well as among
them. The following are the basic components of
MVC architecture:
1. Model: A Model defines the data model
and its access controls. The main
responsibility of this component is to
accept user requests and the data entered by the user and perform the necessary data
related function.
2. View: The function of the view is to accept the data from the Model and convert it to form
that can be seen be a user in a user-friendly way. Thus, view is responsible for displaying
web pages for the user. Any change in the model should also change the view. This can be
achieved using two processes - Push process allows views to register with a model and
change in the data of the model result in pushing the current data to view. Pull process
requires the view to get current data from the model when needed.
3. Controller: A user may be allowed to interact with the web pages created by the View
component. This interaction may be in the form of selection of options of Menu, pulldown
lists, check boxes etc., filling up data in text boxes etc. It is the controller which accepts this
data from the user and initiates suitable actions that should be carried out by the models.
HTTP Methods
GET method: The purpose of GET method is to retrieve the required sources from the server. GET
can also be used to communicate information to the server as part of URL.
HEAD method: HEAD method is like the GET method only, the only difference being that the only
the headers are sent by the response and not the requested resources.
POST method: POST method is used for passing data to the server. However, in POST method data is
passed inside a message and not as part of the URL being sent.
2
Global Key Technologies-IGNOU BCA-MCA Coaching
Nirman Vihar (Laxmi Nagar Branch), New Delhi-110092
011-47508282, 9999106899 | www.globalkeytechnologies.com
as it is not displayed. Sometimes several hidden parameters are also passed along with basic
parameters, in such case, POST method can be used. In general, whenever we want that data should
not be visible on URL, we use POST method. GET method is very useful when we are testing our
applications, as we clearly know the values of different parameters.
Web Containers
A web container is part of Java Enterprise Architecture. A web container is part of a web server. It
relates a client request to a servlet that is to be executed in order to give a response to a request. A
Servlet is a java class that is executed on the server.
A web container is used for translation, if needed, of the server-side script like JSP into a servlet. In
addition, the web container also decides which servlets are to be invoked in order to respond to user
request passed to it.
Some of the most common Web containers are Apache Tomcat, Glassfish, Eclipse Virgo, JBOSS,
WebLogic, WebSphere and so on.