SDSU CS 596 Client-Server Programming
Intro Lecture

[To Lecture Notes Index]
San Diego State University -- This page last updated January 29, 1996

Contents of Intro Lecture

  1. Introduction to Course
  2. Introduction to Client-Server
    1. What is Client-Server?
    2. Theme Examples for Course
    3. What Client-Server Requires of a Programmer
    1. Kinds of Comments
  4. Criteria for Evaluating for Modularity
  5. Computing "Paradigms"
      1. Centralized Multi-user Architecture
      2. Distributed Single-User Architecture
      3. Client/Server Architecture

Introduction to Course

Items To Cover

Introduction to Client-Server

What is Client-Server?

Application that initiates peer-to-peer communication
Translate user requests into requests for data from server via protocol
GUI often used to interact with user

Any program that waits for incoming communication requests from a client
Extracts requested information from data and return to client
Common Issues
  • Authentication
  • Authorization
  • Data Security
  • Privacy
  • Protection
  • Concurrency

Example: World Wide Web (WWW)

Server normally provides data to clients
Often utilizes some data base
WWW data is HyperText Markup Language (html) files
Client Server Programming
<H2>Client Server Programming</H2>
How do the client and server interact
This is the glue that make client-server work
Involves using low level network protocols and application specific protocols
Designing application specific protocols is very important
WWW uses the HyperText Transfer Protocol
Request= SimpleRequest | FullRequest
SimpleRequest=GET <uri> CrLf
FullRequest=Method URI ProtocolVersion CrLf
[*<HTRQ Header>]
[<CrLf> <data>]
<Method>= <InitialAlpha>
uri=<as defined in URL spec>
<HTRQ Header>=<Fieldname> : <Value> <CrLf>
<data>= MIME-conforming-message
What this Course is not

An advanced (or beginning) Networking course

How to use a client builder application/system

What this Course covers

The skills and knowledge required to build client-server applications

Theme Examples for Course

The Client-Server University (CSU) is building a Virtual Campus (VC) where students and instructors interact via the Internet.

CSU needs some help in implementing programs to facilitate activities that currently occur in person.

Posting Grades During the Semester
Faculty currently post grades on their office doors during the semester to let students know how they are doing.

Submitting Final Grades to Registrar
Faculty currently bring signed formalized documents to the registrar with final grades.

Office Hours
Students currently come to faculty offices.

Student Board Game Club
Students currently go to the student union to play chess, checkers and go

What Client-Server Requires of a Programmer



X := X + 1 /* add one to X


"Comments are easier to write poorly than well, and comments can be more damaging than helpful"

Kinds of Comments

X := X + 1 	/* add one to X

/* if allocation flag is zero */

if ( AllocFlag == 0 ) ...

Used to explain complicated or tricky code
*p++->*c = a

/* first we need to increase p by one, then ..
Make code simpler before commenting
(*(p++))->*c = a

ObjectPointer = *ObjectPointerPointer;
ObjectPointer ->*DataMemberPointer = a;
/*  **** Need to add error checking here  **** */

Distills a few lines of code into one or two sentences
Explains the purpose of a section of code
{ get current employee information }   intent

{ update EmpRec structure }     what


Progamming is a process that produces products

source code

Programming is a skill like writing or playing musical instrument

How does one develop a skill?

What is our metric to measure how well we program?

Criteria for Evaluating for Modularity


Decompose problem into smaller subproblems that can be solved separately

Example: Top-Down Design

Counter-example: Initialization Module

Criteria for Evaluating for Modularity

Freely combine modules to produce new systems

Examples: Math libraries
Unix command & pipes

Criteria for Evaluating for Modularity

Individual modules understandable by human reader

Counter-example: Sequential Dependencies

Criteria for Evaluating for Modularity

Small change in specification results in:

Example: Symbolic Constants

const MaxSize = 100

Criteria for Evaluating for Modularity

Effects of an abnormal run-time condition is confined to a few modules

Example: Validating input at source

Computing "Paradigms"

Centralized Multi-user Architecture

Large central computers serving many users

Motivating Factors
Service large number of users (200 to 10,000+)
Centralized storage for large data bases
Minimize data on slow networks

Very stable, very reliable, well supported
Cost-effective why to support thousands of users
Large pool of technical staff
Large number of business applications available
Proprietary hardware and software
Very expensive
Requires large support staff
Costly to incrementally add more capacity
Mind Set
Hierarchical organization (Bureaucratic heaven)

Distributed Single-User Architecture

Motivating Factors
Low cost fast local area networks
Provide small number of users with compute power
Failure of MIS departments to be responsive and cost-effective
Cheap hardware and software
Lots of third-party software
User is in complete control of environment
Low cost to add more users
Sharing of resources across many users is difficult
Networks and OS do not provide good control or management over computer resources
Multivender environments can cause operation, support and reliability problems

Mind set
Individualism (Lone Ranger syndrome)

Client/Server Architecture

Motivating Factors
Limitations of other modes of computing
"Cool" applications like WWW
Utilize easy to use micro computers as front end to mainframe computers
Cost-effective way to support thousands of users
Low cost to add more users
Cheap hardware and software
Provides control over access to data
User remains in control over local environment
Flexible access to information

Lack of Maturity
Lack of trained developers
A threat to the bureaucrats and the lone rangers