Project Risk Analysis

What is the risk that will fail this project

According to my experience, it is quite easy to implement a spreadsheet that can be accessed by a single user even with multiple views. In this project, a spreadsheet must be accessed by multiple users that spread over a network, and different user may have several views of the spreadsheet. I can image there are a lot of network programming. Under the suggestion of Prof. Hans Vangheluwe, it may be easy to use Pyro, which is Python remote object. I have no exprience with Pyro. So the main risk for me is whether Pyro is suitable for this project. So the early work was devoted to learn Pyro and try some examples.

Learn Pyro

  • First, download Pyro and install it.
  • Read Pyro document
  • Try some examples in the download Pyro package.

    How Pyro works

    Since the author of Pyro already gives sufficient information on how to use Pyro, I just give the principal how Pyro works (also from documents).
    1. You write a module 'test' containing a class 'testclass', which will be accessed remotely.
    2. Optional: using the PyroC proxy compiler, you can generate client proxy code for your 'test' module.
    3. The server creates one or more instances of the 'testclass', and registers them with the Pyro Name Server.
    4. The client queries the Name Server for the location of those objects. It gets a Pyro URI (Universal Resource Identifier) for them.
    5. The client creates proxies for the remote objects.
    6. Because the proxy mimics the real 'testclass', the client can now invoke methods on the remote objects. The proxy will forward the method invocations and return the results, just as if it was the remote object itself. Not a single line of network communication code has been written.

    Analysis the Pyro for this project

    In order to access a remote object in Pyro, you must know the object's name that registered in the Pyro Name Server. In our project, we have a single centralize spreadsheet. All the user can not query the spreadsheet until the server was started. So it is possible that giving a specific name to the spreadsheet object, and let all the users know this registered name. This solve the problem when a user initialize a talk with the server. But how about the server initialize a talk to a user. We have to solve the latter one since the server have to notify all the user as soon as the spreadsheet is updated. There are two possible problems:

    1. In python, the client cannot directly give a self reference to a remote object proxy.
    2. If we let clients also be remote objects, there are two options. First, we decide the registered names for them and let the server know these names before it starts. In Pyro Name Server, a remote object must have a unique name. In our project, we donot how many clients may have. So it is difficult to implement in this way. The second option could be dicide the name dymanically and randomly, which means query the Name Server before deciding the name. This option is possible. But it may need a lot of time and energy.

    Based on the above analysis, I would like to implement in the following way: when a client want to access server, it talks to a Pyro proxy object. At the same time, a socket connection between the server and a client is kept so that the server can talk to the client.

    A Simple Implementation

    In this experiment, I have a server that registers an instance of the coordinator class in Pyro Name Server. I also have a Partner class, which can access the instance of the coordinator class by using Pyro proxy object. When an instance of Partner talk to the server, the server will send back a data to all the Partner instances on a network through the socket connection between server and each Partner instance. This is similar to the project requirement that all the clients should notify the update.

    How to run the source code:

    1. start Pyro Name Server
    2. go to the coordinator directory, issue the following command: %python coordinatorserver.py
    3. go to the partner directory, issue the following command: %python Partner.py
    4. log onto another computer on the same network, do step 3 again. You can repeat this step.
    Although the program is very simple and cannot exit. But it tells me that I can implement the project in the way that I proposed above.