C# (pronounced C

Download Report

Transcript C# (pronounced C

Reliable Service Scheduler in a
Distributed Web Service
Environment
John Bouchard
Brad Tiffany
Ethan Towne
Daniel Richard
Are We Done Yet?!?!?!
2
Recap of Project

Service scheduler in a web service
environment
Application
Server
3
Applications
 Two
Applications
 QB
Rating Calculator
 Base Conversion Tool
 Two
Versions
 Windows
Application
 PDA Application
4
Application Design
 Create
Windows Application
 Redesigned UI for PDA
 Client-Server Model
PDA Applications use Client – Server Model
5
Client Side
XML Writer
Server Side
XML Reader
Server Side
Processing
XML Reader
XML Writer
6
Client Side
XML Writer
Server Side
XML Reader
Server Side
Processing
XML Reader
XML Writer
7
Client Side
XML Writer
Server Side
XML Reader
Server Side
Processing
XML Reader
XML Writer
8
Client Side
XML Writer
Server Side
XML Reader
Server Side
Processing
XML Reader
XML Writer
9
Client Side
XML Writer
Server Side
XML Reader
Server Side
Processing
XML Reader
XML Writer
10
Client Side
XML Writer
Server Side
XML Reader
Server Side
Processing
XML Reader
XML Writer
11
Demo Time!
QB Rating Calculator Application
VS.
primecomputing.com QB rating calculator
------------------------------------------------------Comparison of PDA Base Conversion Tool
Vs.
Windows Calculator Application
12
Flagship Application

Application Choice:


Avatar Chat Environment-2D
Combines Game, Chat, Utility
Game: Interactive, Fun
 Chat: Real-time communication
 Utility: Navigate services


Parallels previous team’s Flagship
13
Flagship Application
14
Flagship Application
15
Flagship Application
Scrolled
Movement
Free
Movement
16
Flagship Application
Visible Region
17
Flagship Application
textmap.push("##.#.#.#...#O#O#O..######.#.##");
textmap.push("##.###.#...O....#..#......#.##");
textmap.push("##.#.#.#...#.,*.O..#.######.##");
textmap.push("##.........O.*,.#..#......#.##");
textmap.push("##..###....#....O..######.#.##");
textmap.push("##.#...#...O#..O#.........#.##");
textmap.push("##.#...#....O..#...########.##");
18
Flagship Application
XML Doc:
(Position)
Position X,Y
Velocity X,Y
Player
Client A
Server
XML Doc:
(Message)
Sender
Text
Client B
Client C
19
Flagship Application

Work remaining:



Port to PocketPC
Share info with C# host (on same system)
Add functionality
20
Service Manager
Overview and
Important Design
Decisions
Ethan Towne
21
Service Manager Design
Alters Agent
Queue in
Scheduler
Accepts Client
Connections
Service
Manager
Spawns
Service
Agent
Agent 3
Spawns
Service
Agent
To Client
Agent 2
To Client
22
Service Agents


Each service has own thread called an
“agent”
Each agent only runs when their turn has
come
23
Design Decisions




Asynchronous vs. Synchronous data
reception.
Using polymorphism to launch client
applications
SQL queries used to pull data for server
implementation
Data Transfer Protocol
24
Synchronous

Listening to a socket blocks the thread
until data arrives.
25
Asynchronous

Listening to a socket creates a new thread
and blocks that thread.
26
Polymorphism



Clients implement a common interface
(Base Class).
Server creates a pointer of type interface
(Base Class).
Pointer can then dynamically be set to
point to the needed client application.
27
Database Backend
tblUser
Fields:
Key: usrUD
relServices
Name
Pass
FK: usrID
Info etc.
FK: srvcID
tblServices
Fields:
Key: srvcID
Service Name
Usage
Info etc.
28
SQL Statements

Used to query database for unique data sets. A
simple query:
"Select * from testTable WHERE Name='"+name+
"' AND Pass='"+pass+"'"
29
Relational Statements

Used to select datasets from 2 or more
tables. For example:
“Select * FROM testTable, testTable2 WHERE
testTable.userId = 5 AND testTable.userID =
testTable2.userID;
30
Data Transfer Protocol
XML used to transfer data.
ToXML() and FromXML()
Wraps/Unwraps data transferred into
packets containing important data for the
server.
31
Service Scheduler
Daniel Richard
32
Abstract
Service Scheduler Design
 Handling Input
 What needs to be completed
 Final Product
 Recap

33
Scheduler
Soft RealTime Queue
Priority
Queue
Dispatcher
(service activator)
S1 S3 S2 S4
.Net
Runtime
34
Input Buffer Queue



All Input is passed into an Input Buffer
Queue.
The packets are scheduled according to
their priority or deadline.
The service agent will be given control of
CPU when their packet is dispatched.
35
What’s Next?

Implementation of the Service Scheduler

Complete Implementation of the ClientServer Model

Integration of Client and Server
36
Finished Product

Server executable


Client executable


Requires .Net Framework
Runs on PDA or Emulator
Fully Documented Code
37
Future Semesters





Expand on Database backend
Add PC version of the Client program
Add more Client programs and services
Expand on Flagship Application
Possibilities are endless
38
Recap





Demo of PDA Applications
Flagship Application
Service Manager
Service Scheduler
Finished Product
39
40