So, I ask my self (and you) could I be penalized if I choosed number (2)?
SCJP, SCJD, SCWCD.
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Although I still think my solution is better, I agree with you.
Itapaj�:
but I'm convinced that my old solution is neither acceptable nor good (until some one convinces me the oposite).
Itapaj�:
but when a client calls update without calling a lock, that's his fault.
Itapaj�:
(even because there's no way to know (in my case) whoever locked the record).
// Locks a record so that it can only be updated or deleted by this client.
Your data access class must be called "Data.java", must be in a package called "suncertify.db", and must implement the following interface:
Originally posted by Itapaj� Takeguma:
But to distinguish betwenn clients I created a new class that really makes the access to the data and that has methods like update(recNo, newData, cookie). and my Data.java calls this class's methods.
So, my question is: How can I make my data access class (as says the assignment) implements DBMain.java and still make it have the power to detect the client who is calling it?
So, my question is: How can I make my data access class (as says the assignment) implements DBMain.java and still make it have the power to detect the client who is calling it?
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Originally posted by Andrew Monkhouse:
Hi Itapaj�,
Have you considered creating an instance of the Data class for each connected client? Then you could use the instance of the Data class itself as the owner identifier.
Regards, Andrew
but I think that it is possible that DataAccessObject should not exists to Sun's eyes, because if a programmer is supposed to put all File access in Data.java, it may be possible that a Sun Inspector will look first the Data.java to see how IO is implemented.
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
SCJP 1.4<br />(WIP) SCJD B&S v2.3.3
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Originally posted by Andrew Monkhouse:
Hi Robert,
Nice use case diagrams. It looks like you have separate packages identified as "Data layer" for server and stand alone mode. Is that correct? If so, why?
You are partially right - if you have all your business logic on the server, then your business methods can ensure that any data modification methods are callled from inside lock and unlock calls.
But the question is - does this really meet the requirements? Your instructions indicate (at least in my opinion) that Data must track which client called lock regardless of whether business logic is in the client or the server. So you cannot just ignore the requirement because you found a simple workaround. (If you do, you will probably pass, but you may not get full marks).
I have tried to avoid the general discussion on whether business logic should be on the client or server. If you would like to read up on that, take a look at the thread "Should lock methods be callable by the client".
Regards, Andrew
SCJP 1.4<br />(WIP) SCJD B&S v2.3.3
She's out of the country right now, toppling an unauthorized dictatorship. Please leave a message with this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|