Although a client cannot always be prevented from entering bad data into a database, under NO circumstances should a badly written client be allowed to corrupt a database or make it inconsistent.
The lock/unlock methods appear to me to represent a transactional boundary (Unit of Work pattern) that is best accesed by a Business objecs that then accesses the component(s) in the Persistence/Data Access layer in an appropriate way. For example, if the test was a Banking application and you were implementing a money transfer, you would withdraw money from account and put it in another within a single tranactional boundary, typically in one of your Business objects.
You can still come up with a correct implementation doing the locking on the client side but it is still a bad design IMO.
I think it is far more risky to take this approach than to challenge an ambiguous and possibly faulty spec by doing it correctly.
If 80% of a server job is to serve clients requests through an exposed interface, my server also provides a GUI to let an administrator manage application, network and database settings. It provides functionalities which are not under clients control : database caching, "live" backup, lock timeouts, broadcasting of messages, database opening and shutdown, etc.
Your server provides a cached database to the clients. The fact that they cannot configure it does not mean that they are not provided with it. The fact that your internal processes also use it does not alter the fact that it is provided to the clients.
Yes, it's possible to interpret this differently, and justify it.
Anyway, this thread finished to destabilize me. I decided to get SCWCD before SCJD.
No!!! Don't quit now. Get the real certification first.
but I don't think it's worth tossing out your existing design.
Don't give up!
But I can understand the need to take a break
But if Sun were failing people for writing a 3-tier solution it would be all over this forum.
Hope you will be back after your SCWCD
hope to see you back soon
Nothing could make me more happy than to findout that Sun is not biased towards the Two Tier model for the exam (well.. if i win a million $.. it can make me more happier !!!)
But after Tony's result, im skeptic about taking the three tier approach.
It was sugested to me that I may have lost marks for not providing unbook functionality. - Tony