Beruflich Dokumente
Kultur Dokumente
1. Explain in your own words the diffrerences between client side & Server side
technologies
Objective:
- Client side technologies refer to technologies (or code) implemented and used by
client such as web Browsers and application software client.
- Server side technologies refers to technologies used on the back end server to execute
requests sent by client side.
Goals:
Processing steps:
Reference:
Server-Side vs Client-Side Development
What They Are
Client Side
In client-side programs, the web server send the client a page with the code embedded
and the client (typically the user's browser) processes the code. So the request cycle has
these steps:
The fundamental strength of client side development is that no data has to be sent back
and forth from the user's browser to the web site for processing. For instance, if you have
a form and wish to restrict particular fields so that they can only contain numbers, it is
much more efficient to do this on the client-side using Javascript than to have the user
repeatedly submit the form and then return to to fix errors. Client-side processing
offloads some of the work associated with your development, using the CPU and memory
available on the client, who most likely many fewer processes running at any one time
than the web server.
The problem with client-side development is that you are dependent upon having the
technology available and enabled in the user's browser! Your careful form validation
does no good if your user has a browser that doesn't support Javascript or has it turned
off for some reason (and this is more common than you might think). To effectively use
client-side tools you have to check if the tool is available and then route the user
appropriately, either to a page that can accomodate their capabilities, or to a page
directing them to turn on or download and install the client-side tool(s) needed. You may
also run into an issue that even if the technology is available, it might be an older version
that won't work with your site, and you will have to force the user into an upgrade or
create multiple versions of your content.
Server Side
In server-side programs as we will be creating in this class, the process is a bit different.
Code embedded on pages is processed and output on the server and the user sees only
the completed page. So the request cycle has these steps:
Server-side development requires more trips back and forth from the browser to the
server, but it is usually much more robust and reliable. Since the server is optimized for
the code that is running, the actual processing time for the code itself is faster than if the
same code is run on the client. As a developer, you only have to worry about a single
compatibility issue (what is available on your server) instead of the variability of ever
browser that comes to your site. There is a much wider range of development tools
available on the server side, each with their own strengths and weaknesses, and each
suited to a different kind of user.
Server-side technologies provide access to a much broader range of resources than are
easily available in most client-side tools. Javascript, for example, is severely limited for
security reasons (you don't want anyone with a web site to be able to access your local
file system, nor do you want every user to have access to your web file system!), making
it difficult or impossible to perform tasks that demand writing and reading to files or
databases.
The disadvantage of server-side technologies is the need to traffic back and forth to the
server more often (remember the form field validation scenario above?) and a generally
increased level of complexity because of the increased opportunities and capabilities. If
the language you wish to program in is only available through the older CGI protocol,
then processing time will increase greatly.
How to Choose
There is no single answer to which technology to use for every project. In general,
server-side technologies are preferred over client-side where possible, unless the
function is not vital to the use and operation of the site. For instance, on the class home
page, if a user doesn't have Javascript I am not particularly worried-- they will only be
missing a shortcut for adding a page to their bookmarks, rather than vital content (and,
since the auto-bookmark function demands Javascript anyway, the function is useless
without it). I consider the document information to be more important, particularly since
documents get printed and handed around, so I generate this from the server-side (and it
is much easier and more accurate to access things like file paths and dates from the
server side).
Sometimes you will have no choice. If you wish to use a database with your web site, you
must have access to some server side technology. If you want to provide animations,
interactive games, or audio/video content, you will have to have some kind of server side
technology like Flash, Shockwave, Quicktime, etc (sometimes in conjunction with a
special server for those file types).
Whatever you do, if you do use client-side technologies, don't rely on it alone! Javascript
security or validation is fine if you make allowances for those users who don't have it or
don't have it enabled. For instance, it is ok to validate a form with Javascript, as long as
we are sure to do something on the server side to catch the error and help the user get it
right, rather than just have your web application die with a nasty error message.
2. Give an example where you would use client side technologies & an example where
you could use server side technologies. Explain your example
Example where client side technology would be used in the Web Browswer is to display
data, handling events, etc.
<html>
<body>
<script type="text/javascript">
document.write("Hello World!")
</script>
</body>
</html>
<html>
<body>
<script type="text/javascript">
document.write("<h1>Hello World!</h1>")
</script>
</body>
</html>
<html>
<head>
<script type="text/javascript">
function message()
{
alert("This alert box was called with the onload event")
}
</script>
</head>
<body onload="message()">
</body>
</html>
<html>
<head>
</head>
<body>
<script type="text/javascript">
document.write("This message is written when the page loads")
</script>
</body>
</html>
Example where server side technology would be used in the Web Server is to query local
database for the requested data from the client side.
1.
II
Give an example for company or situation where you would use a 2-tier client-server
architect. Explain
Example:
- Technical Department: Daily Report Website. (ASP + SQL Server) at server side and
Web Browser at client side. The presentation layer (web Browser) is used to get input
from staff. The input consists of several text fields to evaluate the performance of each
input working item. The purpose of the website is just to collect the input and output
to a summary report at the end of the week. There is no clear business logic layer here
In essence, the client handles the display, the server handles the database, and the
business logic is contained on the server side.
- Example of a 2-tier approach is a specialized terminal-to-server application like FTP
client-server software application.
- Customer management website at (Mr. Ngoc Anh’s office): programming language is
VB + SQL Server. The client side has an application software and the server side has
SQL server to response to the data query request from the client side. In essence, the
client handles the display, the server handles the database, and the business logic is
contained on the server side.
Give an example for company or situation where you would use a 3-tier client-server
architect. Explain
Example:
- VDC: The customer care and billing system (CCBS) for internet telephony service
called FoneVNN. (The systems consist of 3 main components: client side (web
Browser, Webserver/Application server (writen in ASP), and Database server
(mySQL). The web browser acts as the client layer, the application layer handles the
business logic, and a separate tier (MySQL database servers) handles database
functions.
-
Explain the difference between the example you gave in part 1, part 2 of this Question
2-Tier 3-Tier
System Admin. Complex Less complex
Reference:
The term n-tier refers to the number of logical levels or layers the various components of
an application occupy. An application consists of the following primary component
layers: Presentation layer, Application or Business Logic layer, and the Data layer. The
presentation layer incorporates user interface components. The user interface might
include Graphical User Interface (GUI) components or be completely text based. A user
interacts with an application through its presentation layer. The application layer or
business logic layer houses the application proper, this means any domain specific
knowledge components needed to power the functionality of the application reside at this
layer. The data layer exists to allow the application layer to capture and maintain
application state data. The data layer might take the form of one or more standalone or
geographically distributed database servers. The "n" indicates the number of levels these
components are split into. This does not mean how many physical computers an
application is spread across, for example, a 3-tier application could very well reside on
one computer but you'll see shortly why this is not usually the case. Before diving deeper
into the n-tier discussion I'd like to talk a little about the term-application.
Now consider how the knowledge contained in a computer program is updated. If the
program update requires source code to be modified, re-compiled, and redistributed to
every user of the program, and the program itself contained the user interface, the
knowledge rules or business rules, and supporting data would be an example of a 1-tier
application. In a 1-tier application, the logical layers of the application are tightly coupled
and an update made to one layer requires an update to the whole. In other words, there
are no separate, logical layers to a 1-tier application.
A 2-tier application would be split logically into 2 layers. This logical split normally
occurs between the business rules layer and the data layer. A 3-tier application would
be logically separated into three layers. As with the 2-tier application architecture, all
layers of a 3-tier application can be collocated on the same computer or each layer may
reside on geographically separated computers connected via a network. The typical
deployment of an n-tier application shows several client computers accessing an
application server. The application server, in turn, accesses the data server. Connections
can be made in the clear or by virtual private networks.
An organization stands to gain many benefits from developing and deploying n-tiered
applications, especially in the Internet age. One of the most important benefits comes
from getting out of the configuration management business. In a 1-tiered application
world, updates to applications must be distributed to every interested user. More often
than not, an application upgrade has unknown side effects on host machines. An
application that runs great in a controlled integration environment may crash a user's
computer because of some untested, Dynamic Link Library (DLL) conflict.
Advantages:
The key features of XML that have led to its widespread adoption are:
- It is simple enough that parsers became available very quickly and were distributed in
most cases as free or open-source software. This meant that the decision to use XML
could be made in many organizations without a lengthy investment review.
- It largely gets rid of low-level character encoding problems by adopting Unicode as its
single character repertoire, allowing worldwide deployment.
- It is sufficiently flexible to handle both narrative documents intended for a human
readership (for example, Web pages) and arbitrary hierarchic data structures intended
to be processed by applications, as well as combinations of the two.
- The syntax itself is human-readable, allowing simple documents to be created or read
using nothing more than a standard text editor.
- There is no turf war: XML is supported by the entire IT industry, and the products
offered by different vendors are highly interoperable.
- These factors mean that today, XML is widely deployed not only for the original
application area of Web content management, but for a large variety of other
applications. In many of these applications, the information needs to be stored
somewhere, and this is where the requirement for XML databases comes from. The
need to store XML As the previous section shows, XML was not initially developed as
a model for storing information. But once an organization has decided to adopt XML
to underpin a key business process, the need to store the information (and, of course,
to retrieve it later) soon follows.
- There are essentially three ways that this can be done:
o Store XML as files.
o Extract the data.
o Use an XML database.
The Extensible Stylesheet Language (XSL) makes a great solution for merging the data
with the layout to provide content. Through the nature of XML, XSL allows you to
separate the data from the layout. As long as you can provide the data in XML format,
you can use XSL to produce content.
Client
1: Client 2: Client
Mobile Browser 3: Web
Phone API
XSL 2
XSL 1 XSL 3
XSL
The kind of client Processor
is identified from
the request
received by the XML Data
server.
Reference:
The Extensible Stylesheet Language (XSL) makes a great solution for merging the data
with the layout to provide content. Through the nature of XML, XSL allows you to
separate the data from the layout. As long as you can provide the data in XML format,
you can use XSL to produce content.
In this article, XSL is used as a server-side solution. This means that the merging or
transformation of the XML/XSL to HTML or ASP occurs on the server. By contrast, you
could also build a client-side solution based on the XML Document Object Model
(DOM) in Microsoft Internet Explorer 5.0. Using this method, Web site content would be
provided separately through XML data, using XSL for layout. For the sake of cross-
browser support, however, I will concentrate on the server-side solution.
Since XSL processes well-formed XML, to use XSL your data must be provided in
XML format. Take a look at the abbreviated product catalog data that's shown in Figure
1. For ease of understanding, in this sample I will use this data in static form. In a real-
world environment you can provide the data using any back end you have at your
disposal. Some obvious alternatives are building the XML through ASP, or using the
XML ISAPI filter for SQL Server.
One of the luxuries afforded by an early render approach is flexibility in how the data is
provided. Data can be provided live at build time via the methods I've outlined, or it can
be provided through static data files. Additionally, the performance of live data is almost
a nonissue. Because each data request occurs serially, you don't have to worry about the
number of concurrent hits the data provider might incur.
You are asked to development XML tags to discribe order data for your company's new
ERP system. Pls write down the tag you would use, together with some example data. use
least 10(ten) difference tags
Process:
Proces
Input s Output
Quality Control
You & your team have developed an accounting system for your company. However , the
employees resist the change from their old. hand written system to the new one. What
would you do to over come the resistance? Explain your actions.