BIT3283 (1) INTRO -Client Server Programming 230911_001

Embed Size (px)

Citation preview

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    1/57

    FSKTMFIND YOUR VOICE AND INSPIRE OTHERS

    Client Server Programming

    (BIT 3283 / BIT32803)

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    2/57

    5/5/2012 Client Server Programming 2

    Concepts

    Standalone (Single User)

    Host Centric (Multi User)

    Client/ServerNetwork Operating System

    Middleware

    Application Layering

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    3/57

    Standalone (Single User)

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    4/57

    5/5/2012 Client Server Programming 4

    Standalone Single User

    Application and Data reside on the same computer

    Dedicated for single user

    Powerful and economical

    Examples: Calculator, MS Word, etc.

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    5/57

    Host Centric (Multi User)

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    6/57

    5/5/2012 Client Server Programming 6

    Host Centric Multi UserHost Centric approach

    Applications and data components reside and execute on onecentralized platform

    Multiple users access the same application on this central platform

    Example : mainframe

    Proprietary Technology

    Host Centric Approach

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    7/57

    Presentation Logic

    ApplicationLogic

    DBMS

    Client

    Server

    Network

    Client (dumb) - Server Model

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    8/57

    Client/Server

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    9/57

    5/5/2012 Client Server Programming 9

    Client/Server Technology

    Client/server technology involves the client and server,both having processing capabilities.

    The client request for a service and the server processesthis request and sends a reply.

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    10/57

    True Client-Server Model

    Presentation Logic

    Client

    Server

    Network

    Application Logic

    DBMS

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    11/57

    Distributed Client-Server Model

    Client

    Server

    Network

    Application Logic

    DBMS

    Application Logic

    Presentation Logic

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    12/57

    Client-server computing is

    distributed access, not adistributed computing.

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    13/57

    5/5/2012 Client Server Programming 13

    Types of services provided by different servers

    File ServersGroupware Servers e.g. Lotus Domino

    Mail Servers

    Newsgroup ServersCalendar Servers

    Workflow Servers

    Database ServersTransaction Servers

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    14/57

    5/5/2012 Client Server Programming 14

    File Server In this case, all the files are stored in a central place called file

    server The entire file is passed to the client over a network

    These type of servers are useful for creating a repository for images,flat documents, and drawings.

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    15/57

    5/5/2012 Client Server Programming 15

    Groupware Servers

    Groupware Servers are software designed to provideservices to a workgroup

    Workgroup is a group of people working on a commontask

    Usually groupware servers handle semi-structuredinformation unlike databases or files

    Groupware is used to Communicate, Collaborate, andCoordinate among teams Allow access to the same data

    Manages concurrency Everyone in the group can work on the same resource

    Improves efficiency of teams

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    16/57

    5/5/2012 Client Server Programming 16

    Groupware Servers Email Services E-Mail: Messages that are sent electronically via computer networks

    A mail server provides e-mail services to computers on a network Mail can be accessed using E-mail clients Mail service can also be used by business application as well Example: when you apply for leave, a mail is sent to the approving manager by

    the leave system

    A mail client uses POP3 or IMAP4 protocol to connect to a Mail server Mail client uses LDAP protocol to access the e-mail address book

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    17/57

    5/5/2012 Client Server Programming 17

    ? POP3 (http://www.learnthat.com/define/view.asp?id=6712)

    POP3 Definition Version 3 of the {Post Office Protocol}. POP3 is defined in{RFC 1081}, written in November 1988 by Marshall Rose, which is based onRFC 918 (since revised as RFC 937). POP3 allows a {client} computer toretrieve {electronic mail} from a POP3 {server} via a (temporary) {TCP/IP} orother[?] connection. It does not provide for sending mail, which is assumedto be done via {SMTP} or some other method. POP is useful for computers,e.g. mobile or home computers, without a permanent network connectionwhich therefore require a "post office" (the POP server) to hold their mail

    until they can retrieve it. Although similar in form to the original POPproposed for the {Internet} community, POP3 is similar in spirit to the ideasinvestigated by the {MZnet} project at the University of California, Irvine, andis incompatible with earlier versions of POP. Substantial work was done onexamining POP in a {PC}-based environment. This work, which resulted inadditional functionality in this protocol, was performed by the {ACIS}Networking Systems Group at {Stanford University}. RFC 1082 (POP3

    Extended Service) extends POP3 to deal with accessing mailboxes for{mailing lists}. (1997-01-09)

    Definition Provided By Denis Howe

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    18/57

    5/5/2012 Client Server Programming 18

    ? IMAP (http://www.definethat.com/define/99.htm)

    IMAP Definition

    Internet Message Access Protocol. An Internetemail protocol which allows access of your email

    from any IMAP compatible browser. Your mailresides on the server level while working withit, versus POP mail which is downloaded intoyour mail program.

    Definition Provided By

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    19/57

    5/5/2012 Client Server Programming 19

    ? LDAP (http://www.definethat.com) Lightweight Directory Access Protocol Definition

    (LDAP) A {protocol} for accessing on-line {directory services}. LDAP wasdefined by the {IETF} in order to encourage adoption of {X.500} directories. The{Directory Access Protocol} (DAP) was seen as too complex for simple {internetclients} to use. LDAP defines a relatively simple protocol for updating and searchingdirectories running over {TCP/IP}. LDAP is gaining support from vendors such as{Netscape}, {Novell}, {Sun}, {HP}, {IBM}/Lotus, {SGI}, {AT&T}, and {Banyan} AnLDAP directory entry is a collection of attributes with a name, called a distinguishedname (DN). The DN refers to the entry unambiguously. Each of the entry's attributes

    has a {type} and one or more values. The types are typically mnemonic strings, like"cn" for common name, or "mail" for {e-mail address}. The values depend on thetype. For example, a mail attribute might contain the value"[email protected]". A jpegPhoto attribute would contain a photograph inbinary {JPEG}/{JFIF} format. LDAP directory entries are arranged in a {hierarchical}structure that reflects political, geographic, and/or organisational boundaries. Entriesrepresenting countries appear at the top of the tree. Below them are entriesrepresenting states or national organisations. Below them might be entriesrepresenting people, organisational units, printers, documents, or just about anythingelse. {RFC 1777}, {RFC 1778}, {RFC 1959}, {RFC 1960}, {RFC 1823}. {LDAP v3(http://www.kingsmountain.com/LDAPRoadmap/CurrentState.html)}. [Difference v1,v2, v3?] (2003-09-27)

    Definition Provided By Denis Howe

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    20/57

    5/5/2012 Client Server Programming 20

    ? Active Directory (http://www.definethat.com/define/5452.htm)

    Active Directory Definition

    A {directory service} from {MicrosoftCorporation}, similar in concept to {Novell}

    {Netware Directory Services (NDS)}, that alsointegrates with the user organisation's {DNS}structure and is interoperable with{LDAP}. Active Directory is included in{Windows 2000}. (2000-03-28)

    Definition Provided By Denis Howe

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    21/57

    5/5/2012 Client Server Programming 21

    Groupware Servers Newsgroup Server

    Newsgroup server provide bulletin-boardlike services

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    22/57

    5/5/2012 Client Server Programming 22

    ? RSS (http://www.webopedia.com/TERM/R/RSS.html)

    RSS is the acronym used to describe the de facto standard for thesyndicationof Web content. RSS is an XML-based format and while it canbe used in different ways for content distribution, its most widespread usageis in distributing news headlines on the Web. A Web site that wants to allowother sites to publish some of its content creates an RSS document andregisters the document with an RSS publisher. A user that can read RSS-distributed content can use the content on a different site. Syndicated

    content can include data such as news feeds, events listings, news stories,headlines, project updates, excerpts from discussion forums or evencorporate information. Because there are different versions of RSS, theterm RSS is most frequently used as a name to mean the syndication ofWeb content, rather than as an acronym for its founding technology. Whenusing the name RSS the speaker may be referring to any of the followingversions of Web content syndication:

    RDF Site Summary (RSS 0.9, RSS 1.0) Rich Site Summary (RSS 0.91, RSS 1.0) Really Simple Syndication (RSS 2.0)

    http://www.webopedia.com/TERM/R/syndication.htmlhttp://www.webopedia.com/TERM/R/XML.htmlhttp://www.webopedia.com/TERM/R/XML.htmlhttp://www.webopedia.com/TERM/R/syndication.html
  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    23/57

    5/5/2012 Client Server Programming 23

    Groupware Servers Calendar Services

    Calendar servers provide organization wise scheduling andCalendar services

    Calendar servers can be used to setup meetings, reminders andscheduling events

    Team members can view others calendar as well

    Application can also use Calendar services for automatic schedulingevents

    Can be used to even block resources (people, conference, rooms etc)

    Calendar Services

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    24/57

    5/5/2012 Client Server Programming 24

    Groupware Servers Workflow services

    Workflow: A workflow is a set of interdependent tasks that occur in a

    specific sequence. All these tasks together complete a business process

    Workflow services are predominantly used in business application Many business transactions require workflow In any application, Workflows can be part manual and part automated

    Example: Deposit of a cheque in bank does not end with the deposit After the initial step of deposit, the cheque goes in for clearing from the

    issuing bankIf cheque passes, amount is transferred to payees account from the

    payers accountTo transfer amount from payers account, there are several steps (Both

    physical and electronic) If cheque bounces, then action taken is different. All these tasks put together complete the deposit workflow

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    25/57

    5/5/2012 Client Server Programming 25

    Groupware Service - Workflow

    Workflow servers offer workflow services

    Can create a workflow which consists of tasks

    Can provide decision making points in the

    workflow

    Programmer can define the workflow paths

    Business Applications can use these workflows

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    26/57

    5/5/2012 Client Server Programming 26

    Groupware Servers - Workflow example - Leave System

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    27/57

    5/5/2012 Client Server Programming 27

    Groupware Servers - Workflow example - Leave System

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    28/57

    5/5/2012 Client Server Programming 28

    Database Server With Database servers the client passes SQL requests as

    messages to the database servers . The code that processes the SQL request and the data reside on

    the same server.

    The server uses its own processing power to find the requesteddata. Play an important role in data warehousing.

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    29/57

    5/5/2012 Client Server Programming 29

    Transaction Servers

    Client Invokes remote procedures/services that reside on the SQLdatabase engine

    TP Monitor (Transaction Processing Monitor) provides TransactionManagement

    These remote services execute Group of SQL statements

    The Network exchange consists of single request/reply message.

    These SQL statements either all succeed or fail which is ensured by

    transaction server with TP monitors. Server side business logic typically consists of database

    transactions.

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    30/57

    5/5/2012 Client Server Programming 30

    TP Monitors

    Routing and Load balancing Same Application can be run on multiple machines for handling load TP monitor is used for load balancing to route a request to least loaded

    member of a server machine Run-time platform for distributed application

    Types of TP Monitors TP Light (Lite)

    An extension to database Example: Sybase Transact SQL, Oracle PL/SQL

    TP Heavy Uses database, but outside the database Allows application programmer to write business logic services

    Additional Services like scheduling, queuing, buffering etc Security services like Encryption, authentication, and authorization Example: BEA Tuxedo, IBMs CICS

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    31/57

    5/5/2012 Client Server Programming 31

    TP Monitor

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    32/57

    5/5/2012 Client Server Programming 32

    Features of a Client/Server system

    Service: There is a relationship between client and server process.

    Multi-user support: A single server can entertain requests at a time from many clients

    Can share common resources

    Transparency of location: (NOS) The environment masks the location of servers from application

    Can be accessed from any location

    Mix and Match of platforms:

    Client and server can be mixed and matched for heterogeneousplatforms

    i.e. hardware and operating system can be well intermixed.

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    33/57

    5/5/2012 Client Server Programming 33

    Features of a Client/Server system

    Scalability: Scalability of a server or an application is the

    ability to provide service without degradation inperformance as load increases

    - Client Server applications provide scope forscalability of application

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    34/57

    Network Operating System(NOS)

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    35/57

    5/5/2012 Client Server Programming 35

    Network Operating System (NOS)

    Many of the network based services like Fileservices, Mail Services etc. are analogous toservices provided in a system by the OS

    A NOS is an extension to OS that providestransparent access to resources on a network. Examples

    Novell Netware

    UNIX and its variants (HP-UX, Linux) Windows NT, Windows 2000 Adv Server, Windows 2003

    Adv Server

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    36/57

    5/5/2012 Client Server Programming 36

    Features of NOS Location transparency: Can access services anywhere

    XNet (Extranet) in Infosys can be used to log into Sparsh from anywhere in the

    world through a secure network

    Logon transparency Same User Id can be used across multiple applications User Authentication done using a common and central system

    Examples: Win NT Domain, Kerberos in UNIX world

    Replication transparency: Automatic backup and recovery mechanisms One server failure will not result in entire application going down Since difference services are running on different physical servers, failure in one

    will not impact on all operations of applications Example: If Mail server goes down, only mail service is affected

    Mirror servers are used to avoid failure in critical applications

    Resource Sharing: Sharing of resources like files, folders, printers etc

    Directory Services: Single point for accessing all the resources in a network Example: Network Neighbourhood, LDAP Protocol used to access directory

    services

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    37/57

    Middleware

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    38/57

    5/5/2012 Client Server Programming 38

    Middleware

    Middleware is software glue between Client andServer, which helps the communication betweenthe client and the server

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    39/57

    5/5/2012 Client Server Programming 39

    Types of Middleware

    Peer to Peer interfaces (P2P) Indicates End to End communication in the same protocol Since the protocol is symmetrical sometimes it is called program to program. In this type of network each workstation has equivalent capabilities andresponsibilities. Example: File sharing systems (Napster etc), Instant Messengers

    Remote Procedure Call (RPC) Middleware that allows a computer program running on one host to cause code tobe executed on another host remotely

    Programmer doesnt have to explicitly code for achieving this. Middleware provides libraries or functions to achieve this

    Message Oriented Middleware (MOM) Uses a queue like structure to pass messages between two hosts Asynchronous connectionless, asynchronous transactional message store-and-forward capability.

    Object Oriented Middleware Same as RPC but uses method invocation E.g. ORB (follow CORBA Architecture)

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    40/57

    5/5/2012 Client Server Programming 40

    Remote Procedure Call (RPC)

    Client process invokes a remotely locatedprocedure in a server process Server process may or may not reside on the

    same physical machine as the client

    When a client invokes a remote procedure

    The remote procedure executes as if it is a localfunction call

    Sends the response back to the client process Involves network communication for data

    transfer

    RPC uses synchronous communicationbetween client and server Client is blocked until server responds (Client is

    typically in a wait state till the responds) Proceeds further only after the server responds.

    RPC

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    41/57

    5/5/2012 Client Server Programming 41

    RPC Middleware provides the infrastructure for creating a client-server

    application

    Translating of clients request into a server side call is handled bymiddleware

    Application programmer need not worry about network programming

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    42/57

    5/5/2012 Client Server Programming 42

    RPC - Working of a Simple Server

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    43/57

    5/5/2012 Client Server Programming 43

    Message Oriented Middleware (MOM) A client/server infrastructure that is asynchronous in

    nature Client does not wait in a blocked state till the serverresponds

    Client can do other tasks while the server processes therequest

    Interoperability: Allows the application to bedistributed over multiple heterogeneous platforms.Examples: A mainframe talking to a non-mainframe applications IBM MQ Series is one such Message Oriented

    Middleware, JMS in J2EE Applications

    Reduces complexity of developing applications that

    span multiple operating systems

    Masks the application developer from the details ofthe various operating system and network interfaces

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    44/57

    5/5/2012 Client Server Programming 44

    MOM Client initiates communication by putting messages on to the Message

    queue

    No interaction with server process (de-coupled), thus achievesasynchronous communication Client can continue with other work after putting a message in queue

    Message queues also provide temporary storage when the destination program is

    busy or not connected

    Server uses another queue to send responses back

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    45/57

    5/5/2012 Client Server Programming 45

    Comparing MOM and RPC

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    46/57

    Application Layering

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    47/57

    5/5/2012 Client Server Programming 47

    Application Layering

    Splitting an application in a Client/Server Architecture

    An application can be split from two perspectives

    PERSPECTIVE # 1 : From the perspective of the differentfunctionalities Presentation Logic Business Logic Data Source

    PERSPECTIVE # 2 : From the perspective of the concentration of

    functionalities Fat Client Fat Server

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    48/57

    5/5/2012 Client Server Programming 48

    PERSPECTIVE # 1 : Application Partitioning - Gartners Group Model

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    49/57

    5/5/2012 Client Server Programming 49

    PERSPECTIVE # 1 : Gartner Group Model

    Distributed Presentation Logic: A part of the presentation layer goes to theclient. The other part of presentation layer, business and data managementlayer goes to the server.

    Remote Presentation Logic: Only the presentation layer goes to the client.Business and data management layer goes to the server.

    Distributed Business Logic: The presentation layer and a part of thebusiness layer goes to the client. The other part of business layer and datamanagement goes to the server.

    Remote Data Management: Both the presentation and business layer goesto the client. The data management layer goes to the server.

    Distributed Database : Presentation layer, business layer and a part of thedata management layer goes to the client. The other part of the datamanagement goes to the server.

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    50/57

    5/5/2012 Client Server Programming 50

    PERSPECTIVE # 2 : Fat Client and Fat Server

    Fat Client: Most of the applications coderesides on client side

    Fat Server: Most of the applications coderesides on the server side

    What is Thin Client and Thin Server?

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    51/57

    5/5/2012 Client Server Programming 51

    PERSPECTIVE # 2 : FAT Server vs FAT Client

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    52/57

    5/5/2012 Client Server Programming 52

    Client\Server Architecture : 2 Tier

    Two-tier applications remain the most common client/serverarchitecture.

    The entire application is decomposed into two sets of services.

    The client combines UI services + business services and the otherdata services.

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    53/57

    5/5/2012 Client Server Programming 53

    Client\Server Architecture : 3 Tier

    It decomposes an application into three sets of services: UI,

    business, and data.

    Business logic is moved to an application server

    Shared data to a database server

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    54/57

    5/5/2012 Client Server Programming 54

    Client\Server Architecture : 2 Tier Vs 3 Tier

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    55/57

    5/5/2012 Client Server Programming 55

    References

    1. http://www.lausch.at/gnome/programming

    2. docs.sun.com/source/816-5698-10/basics.htm

    3. www.ois.com/resources/corb-2.asp

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    56/57

    5/5/2012 Client Server Programming 56

    Summary Standalone (Single User)

    Early computing systems, standalone single-user applications

    Examples: Calculator, text editor etc

    Host Centric (Multi User) Mainframe systems, UNIX systems with terminals Reporting applications, banking etc

    Client/Server Client and Servers both have processing capabilities Different types of services provided by servers

    Network Operating System

    Middleware Peer to Peer RPC MOM

    Application Layering

  • 8/3/2019 BIT3283 (1) INTRO -Client Server Programming 230911_001

    57/57

    Thank You!