About Users Developers |
DesignRegistrationProblem comes from the idea of setting up tauZaman system as a server. 1. Problem definitionAt the website cs.arizona.edu, a tauZaman server is running. The server performs I/O in the Gregorian, Astronomy, and Islamic calendars. Christian at Aalborg and Curtis at WSU both want to use the service, but Christian wants his dates formatted differently (in Danish) than does Curtis (in English). So Christian starts a session with the service, then pushes the format properties that he would like. Curtis does the same. Christian then asks the server to create several instants by calling the Instant constructor. He passes a string containing a date (in Danish) to each constructor. The problem is that in both Multical and timeADT (and our current design of tauzaman) the properties are stored in the CalendricSystem object. There is a single copy of each property (or property stack). In the above scenario, this means that since I pushed my formats after Christian pushed his, then when Christian tries to format a date, he uses my properties. To implement a CalendricSystem service we somehow need to have each user have their own properties. So the properties have to be stored or association with user specific session. 2. Proposed SolutionThe most important design criteria for TauZaman client and server are (in order);
1. ones, which are defined as remote objects. 2. ones, which are defined as serializable objects. 3. ones, which are neither remote objects nor serializables. (normal classes) First type is needed, since we want to utilize a server's service but we want to do it transparently from the programmer. In other words, from the usage of a remote service, a programmer should not be aware of whether this service is a remote or a local one. Remote objects are formed in server sides and are passed to client as references. Second type is needed, since when we form a temporal data type, we may need a remote service to parse a string temporal constant and return a Granule array to us. Since we want temporal data types live locally in client side, we have to pass server side produced Granule array by value. So, we have to declare Granule class as serializable. Third type consists of other classes, which don't involve in client/server side interaction. For example, Instant, LeftOperandSemantics, etc. Having stated types, let's try to identify them for each class in tauzaman package by package;. 2.1 Define Remote Objectstauzaman TauZamanSystem, TauZamanRemoteServiceHandlerImpl, TauZamanRemoteServiceImpl, TauZamanLocalService classes and TauZamanRemoteServiceHandler, TauZamanRemoteService interfaces.
2.2 Define Serializable Objectstauzaman.timestamp Granule, TimeValue classes.
tauzaman.calendricsystem Granularity (since Granule contains Granularity in it)
2.3 Define Normal Objectstauzaman.calendricsystem, tauzaman.timestamp all classes except above
tauzaman.calendar, tauzaman.field, tauzaman.temporaldatatypes, tauzaman.property all classes
After defining the types of different TauZaman classes, now let's try to design the over-all client/server structure. 3. Structural Design (Client/Server)Every TauZaman system has one CalendricSystemRepository, which manages the CalendricSystems living in the system. Since there may be more than one user using the same system, they may use single CalendricSystemRepository to load and use different CalendricSystems. Each of these users will have their own active CalendricSystem, which will be chose from their CalendricSystem set. Also, each of these users will have a PropertyManager for each different CalendricSystem they have, since one user may want to use one set of formatting properties and other may want to use others independently without any conflicts. Let's see all this in Figure 1 below. |