Architecture and Interfaces in the Street-Smart Project

 

Team 6- The Big Endians

 

Deployment Diagram:

 

The clients (cars) connect to GPS Server and first send the name of their destination street. After that, at regular intervals, they send queries about the next step that they need to go to, in order to reach their destination. The GPS Server gets the car position information from satellite. Using its embedded algorithm, the GPS Server calculates the shortest route that the client can take in order to reach its destination and then returns this next step information to them. The database server stores all the states and session information about each query from different clients.

 

Test Case

 

Servers

 

The system has three types of servers: satellite server, database server and GPS server.

The GPS server is the main server we focus on. Satellite server tells the GPS Server what it observes from the car.  The database server stores static map information, the states and session information about each query from different clients.

 

The following tables describe the details of these servers. Notice that the types of server are more conceptual than physical.

 

Satellite Server

 

Description

This server represents a GPS satellite

Functions

The only function of the satellite server is to detect the position of each client.

Type

It is considered as an external server with 100% reliability and availability. (pretty much like a credit-card info server in E-commerce)

Invocations

It does not invoke any server

It gets invoked only by the GPS server

State management

Does not store any state information

 

Interface definitions

Satellite Interface

 

Operations

String getNewLocation (Position currentStreetName, String clientID, Vector streetOptions)

 

Database Server

 

Description

This server contains all the information about the different streets in the city

Functions

Database management

Type

It is considered as an external server with 100% reliability and availability.[H1] 

Invocations

It does not invoke any server

It gets invoked only by the GPS server

State management

Does not store any state information

 

Interface definitions

All the database management will be handled through contained managed persistence

 

 

GPS Server

 

Description

This is our main server. Here we will implement the main functionalities of the system.

Functions

Inform the client's current position

Suggest the optimal route to reach the destination (return an next step object which contains the next street name as well as other necessary information)

Query the satellite server for the position of the car (based on the possible set of streets the client can turn into from the original street)

Manages the sessions of its clients

Invocations

It invokes the GPS Satellite

It invokes the Database Server

It is invoked by the GPS client

State management

For each client it holds:

The session ID

The entire route to the desired destination

The actual position of the client

The history movement of all clients in their life cycle

Interface definitions

GPSServer Interface

Described in the GPSServer Interface definition below

 

 

 

 

Client

 

The clients in the system are the cars.

 

Description

The client is supposed to be a GPS device located in some vehicle

Functions

The only function of the satellite server is to detect the position of each client.

Invocations

It invokes the GPS server

State management

Does not store any state information

 

Interface definitions

 

 

 

 

 

Some supplement about clients:

·        Main purpose: To reach their destination/know their current location

·        It invokes the GPS server. Every time it comes to an intersection or every 5 seconds.

·        There can be up to 420 clients concurrently logged into the server at any given time.

·        If destination address not in database, client needs to select another destination.

·        Information lost, the client has to resend the information

 

 

Exceptions/ Errors Generated

 

The following are exceptions in our system. Notice that we have an assumption in our project is that the system has database integrity, so we need not consider exceptions about no-meaningful data.

 

·        Destination Address not in Database

·        Invalid ID

·        Conflicting ID

·        Satellite Connection Timeout

·        Cannot identify next step

·        Information Lost

·        Cannot connect to satellite

·        Cannot connect to database

 

 

Interface

 

The following are our interfaces, each of which has some methods.

 

GPS Server Interface

Route getService(String destination) // Gps server returns a unique id for this client which is a data member of object Route;

Boolean stopService(String id)

Route getNextStep(String id)

 

RouteFinder Interface

Route getRoute(Position currentLocation, Position destinationLocatin )

 

Satellite Interface

Position getNewPosition( Position currentLocation, Position [] alternatePosition, Position destinationLocation, String id)

 

Database

 

There are two data domains in our database. One is map, the other is client.

·        Map domain identifies the information about the map. Two optional designs are offered now. Map information is entity.

·        Client domain identifies the information about each session of each client. Client information is session.

 

 

Map Design

 

-- Design 1 --

In this design, we have only one table and each record in this table represents part of a road between two intersections

 

[MapTable]

Columns:

 

ID (primary key)

int Start_Location_x

int Start_Location_y

int End_Location_x

int End_Location_y

String Street_Name

 

-- Design 2 --

In this design we have two tables (Intersection, RoadName) and each record in the Intersection represents an intersection of two roads.

 

[Intersection]

Columns:

 

ID (primary key)

int Location_x

int Location_y

int Forward_RoadId

int Backward_RoadId

int Right_RoadId

int Left_RoadId

 

 

[RoadName]

columns

 

ID(primary key)

String RoadName

 

Clients

 

Columns:

String ID (primary key)

int Current Location x

int Current Location y

int Destination Location x

int Destination Location y

String History

 

Question

 

We analyze the architecture of our design; we found the following questions, which need to answered or determined:

 

·        Do we need a 3rd party server?

·        Is our flow of events all right?


 [H1]I think we cannot say that the database server is 100% reliable, I suggest to say we dont deal with the fault-torrent issue inside the database server.