First off, we can define the overall system. This is easiest done in a picture.
So there are five elements to the system:
- A tablet user app.
- A Web Server that interacts with the tablet receiving requests and forming data responses
- A Web controller that manages all of the data management and manipulation
- A Data controller that is the interface between the Web controller and the Database
- A Database that holds each user’s data securely.
We then have to define what is needed to to make this work from a software support point of view. It is easy to say that “we need a web server” but it is a bit more difficult than that. We have a problem in that the project will be developed on a single machine but will have to be designed so that it could, if implemented, be run on a network of machines – maybe on virtual machines (VMs) in the cloud, such as Amazon AWS. The implication from this is that, although the program will be developed on a single machine, I have to ensure that the communication between the web server delivery to the user is connected to the web controller by a web server interface. This means that I have to have two web servers running on the single machine, so both will have to use different ports. The Smalltalk Seaside software that I use to develop the web side of things normally looks out through port 8080. I will need to start a second server looking out on port 8081. This will provide the separate servers that I require.
The following diagram illustrates a typical data flow. Assume that the android device responds to a request by the user for information on the next train to be run. (Normally, the data would be more inclusive than that shown but I have cut down the data in the flows for clarity. The REST* requests are correct though).