Ok, some more details about my assignment choices:
I submitted my assignment at June 21, 2011 and took my essay a week later. After almost 20 weeks of waiting my assignment was graded...
I choose a 3 layer architecture
- data accessor layer (database)
- business layer (containing the available services, like book and search)
- presentation layer (Swing GUI)
Data access layer:
-----------------------
* created my own interface that extends the given Sun interface with some extra methods
* Data class is a Singleton
* Data class contains 2 helpers: 1 for Locking and 1 for DB access
* Concurrent access is handled by a ReadWriteLock, locking by a ReentrantLock
* I implemented a shutdownhook
thread that saves my database content at shutdown (and noted the disadvantage)
* Used a record cache for the database during runtime
* For the lock cookie I used the Thread id (yes yes I used sockets !!)
* Did not implement the 48 hour (I have no idea why people talk about this anyway, it's just some marketing bla bla in the introduction of the instructions.html)
* Used some value objects, like Record, instead of a
String[]
Business layer:
-------------------
* Created an interface Services, that has 2 implementations. One for local access and one for networking mode
Presentation layer:
------------------------
* Used BorderLayout and and mostly GridBagLayout
* Used a configuration window at startup to set the parameters for the mode its running in (host, port, db location)
Networking:
---------------
* I used Sockets! I just have experience with them and you have more control about what's happing over the line.
* Motivation for NOT using RMI (which I did NOT put in my choices.txt):
- I didn't want to create stubs
- I didn't like all those RemoteException declarations in the interface
- I can't used the Thread id to identify clients (ok, this one was noted in choices.txt; the other two are not good reasons I know)
* I used some Request / Response message classes for sending and receiving over the line.
General:
-----------
* 2245 lines of code
* create
java API docs for all classes and all methods/fields (even private ones)
* Used an
ant script to build and validate my project
Uhm I could probably tell a lot more, but hey it has been almost half a year since I looked at my code lol. If someone wants to know some more, then please ask.
Looking at my score: 371
This means to me: every part was ok, no big mistakes
I wonder if they still use the 'or 0/80 or 44/80 or 80/80' for locking. If so, then I got 80 points there ;)
Cheers,
Dennis