Originally posted by Siddharth Mehrotra:
hi Pauramo,
Great news to hear that you have cleared the SCJD exam.
why dont you carry out the tradition and help meek coders like us by giving advice , as to what were your design patterns and what part of the code yo were really bugged. how did you get over it ...
my questions will go on and on and on.....
in short what all you expected others to tell you why dont you tell it to us
Well, first of all I used RMI. The network server (RMI-class) and Data-class extended the same interface (DataInterface) although the RMI-one through inheritance (DataInterface -> DataNetworkInterface). The DataNetworkInterface also inherited Remote.
The locking was implemented with simple List of Lock-objects (containing information if a certain record is locked or not). The change of the state of these objects was synchronized with the lock-object (very granular). I didn't use client-tracking and timeouts. The lock-all stuff i did like this: I had one special java.lang.Object which was used to synchronize the lock-all portion of the code. This lock-all portion just looped through all the records and did the exactly same thing as the lock-one portion.
The search was very simple: at first it constructed a list of objects which contained the search-conditions in a way which was easier to use when looping through the whole database. Then just the looping.
The documentation I did with html (the user-instructions and explanation of the design choices) plus the readme.txt.
I had the whole application in one jar (both the client and the server). This jar was of course in a bigger jar which contained all the docs and so on.
Well, does anybody want to know more? I won't post the whole code or anything though...
(pauramo -> Perttu Auramo)