Rudimentary Client-Server Message Board Ricky Landry COP5611 - PowerPoint PPT Presentation

1 / 20
About This Presentation
Title:

Rudimentary Client-Server Message Board Ricky Landry COP5611

Description:

Client Database Design. The client has its own database that contains the client state. Has four containers: One containing MbdbTopic objects. One containing ... – PowerPoint PPT presentation

Number of Views:111
Avg rating:3.0/5.0
Slides: 21
Provided by: ucf61
Learn more at: http://www.cs.ucf.edu
Category:

less

Transcript and Presenter's Notes

Title: Rudimentary Client-Server Message Board Ricky Landry COP5611


1
Rudimentary Client-ServerMessage Board Ricky
LandryCOP5611 Operating Systems Design
PrinciplesUniversity of Central FloridaApril
16, 2012
2
Fundamental Requirements
  • Ability to create topics
  • Ability to create comments associated with a
    topic
  • Ability to produce information on the author of a
    topic or comment
  • Ability to produce the timestamp of creation and
    last modification time of a topic or a comment
  • Ability to remove a topic or comment (only if
    requested by the author)

3
Critical Design Decisions
  • Client-Server Architecture
  • Multi-threaded Server
  • Stateless
  • Messaging Protocol
  • Java Swing Client Front-End (GUI)

4
Message Board Database
  • Server-side database was written specifically for
    the application to explore design challenges
  • Multi-threaded server design required mutually
    exclusive access to the database to handle
    concurrency and atomicity concerns
  • Accomplished through the use of object locks
    built into the Java language
  • synchronized(this) wraps database access
    calls

5
Server Database Design
  • Singleton-patterned database consists of
  • List of MbdbTopic objects, stored as a Hashtable
  • List of MbdbComment objects, stored as a Hashtable

6
Server Database Design
  • MbdbTopic object consists of
  • topic name
  • author name
  • creation time
  • topic header
  • deleted state
  • list of the comment headers of child comments

7
Server Database Design
  • MbdbComment object consists of
  • comment message
  • author name
  • creation time
  • comment header
  • deleted state
  • unique identifier of its parent topic

8
Server Database Design
  • TopicHeader and CommentHeader Objects contain
  • Topic/Comment unique identifier
  • Topic/Comment last update time
  • Definition of TopicHeaderList and
    CommentHeaderList containers, respectively

9
Server Design
  • Used the Java Serialization API for serialized
    object transfer between server and client.
  • Listen socket is a Java ServerSocket object
  • When a connection is made, the new socket
    connected to the client is handed off to a worker
    thread spawned specifically for the client

10
Server Design
11
Protocol Design
  • Defines the following aspects of the
    client-server model
  • Credentials
  • Topic message data payloads
  • Comment message data payloads
  • Message structure
  • Message types

12
Protocol Design
  • Client-to-Server Message Types
  • CREATE_TOPIC
  • CREATE_COMMENT
  • REMOVE_TOPIC
  • REMOVE_COMMENT
  • GET_TOPIC_HEADERS
  • GET_TOPIC_OBJECT
  • GET_COMMENT_OBJECT
  • CREDENTIALS
  • CLOSING_CONNECTION

13
Protocol Design
  • Server-to-Client Message Types
  • TOPIC_HEADERS_REPLY
  • TOPIC_OBJECT_REPLY
  • COMMENT_OBJECT_REPLY
  • AUTHETICATION_SUCCESS
  • AUTHETICATION_FAILURE
  • INVALID_TOPIC_ID
  • INVALID_COMMENT_ID
  • INVALID_REPLY_RECEIVED

14
Client Database Design
  • The client has its own database that contains the
    client state
  • Has four containers
  • One containing MbdbTopic objects
  • One containing MbdbComment objects
  • One containing the read state for each topic
  • One containing the read state for each comment
  • Defines wrappers for Topic/Comment objects and
    their respective read state

15
Client Database Design
16
Client Controller Design
  • Responsible for client database management and
    access
  • Updates the client database with server data
  • Provides current (undeleted) client data to the
    front-end
  • Responsible for communication with the server
  • Responsible for managing client credentials

17
Client Front-End Design
  • Built using the Java Swing API
  • Provides basic interface to underlying function

Topic Window Mockup
Comment Window Mockup
18
Client Front-End Design
19
Client Front-End Design
Topic Window
Comment Window
20
Questions
  • ?
Write a Comment
User Comments (0)
About PowerShow.com