Hi Oli,
I would recommend against this.
In the real world, you would be able to go back to your project manager or architect or client and talk through this issue, explaining why your concept is better. But in this case, we do not have that luxury - we have been given instructions, and should follow them.
You
might get lucky and have an examiner who agrees with your reasoning (there have been cases in the past where people have deviated wildly from the specifications and passed). Or you might get an examiner like
Terry got who decides that
every comment (no matter how minor) in your specification must be adhered to.
Do you really want to risk having a perfect solution failed on a technicality?
The reason why I have done it this way is that storing the cookie as the key in the WeakHashMap would not enable me to determine whether the client has crashed or not.
In my opinion, this is a dangerous argument to make:
You are deviating from the specifications in order to implement something that is not a requirement.If you really want to handle client crashes, there are other ways of doing it which do not require you to violate the specification. For example: using the Unreferenced interface to find out when you client has crashed. Regards, Andrew