your unlock method is calling an openFile() method and a setUserId() method that are not in any interface I have seen
Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
Don't forget about that scenario.
How should I restrict a client from locking more than 1 record?
Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
Roel De Nijs wrote:But your Data class could also be used without your business service, via another application. Don't forget about that scenario. So your Data class should be thread-safe on its own, so it can function flawlessly without your business service.
OCMJEA, OCJP, OCJD, OCE SQL, OCP Forms Developer, OCP PL/SQL Developer
OCMJEA, OCJP, OCJD, OCE SQL, OCP Forms Developer, OCP PL/SQL Developer
OCMJEA, OCJP, OCJD, OCE SQL, OCP Forms Developer, OCP PL/SQL Developer
So it would be interesting to have a view on why you decided Data class is front-end class and develop a business layer.
I'll guess you have opted for a thick client approach?
I'll guess your Data class is nothing more but delegating the methods to the business layer?
And because the section about the Data class is located in the Server section of the instructions, I'm inclined to say that your approach is wrong and will result in failure, but that's just my thought.
OCMJEA, OCJP, OCJD, OCE SQL, OCP Forms Developer, OCP PL/SQL Developer
OCMJEA, OCJP, OCJD, OCE SQL, OCP Forms Developer, OCP PL/SQL Developer
Roel De Nijs wrote:What's the added value of the class(es) you'll create in 2? I would think your business service implementation invokes the methods of the Data class and you'll make sure that each client has a unique instance of the business service, so you can identify your clients uniquely. But maybe I'm missing something in your design.
OCMJEA, OCJP, OCJD, OCE SQL, OCP Forms Developer, OCP PL/SQL Developer
Dmitry Kotlov wrote:Did you mean 3 instead 2?
I inderstand it this way: when application was started as a network server (by means of command line parameter) it must handle multiple users requests, but when it started in alone mode and there is only one client of the database it may but not must handle multiple users requests. Of course interface is the same for all modes but in local mode lock and unlock methods are empty, and in server mode they provide neccessary functionality. Actually I create two classes one is for local mode and the other one is for server mode. The second class decorates the first one by adding multiple users support.You may assume that at any moment, at most one program is accessing the database file;therefore your locking system only needs to be concerned with multiple concurrent clients of your server.
OCMJEA, OCJP, OCJD, OCE SQL, OCP Forms Developer, OCP PL/SQL Developer
instructions.html wrote:// Locks a record so that it can only be updated or deleted by this client.
Roel De Nijs wrote:Ok, I understand what you are trying to do in step 2. But don't you think it would simplify your design if you have 1 Data class which can be used in both modes than having seperate implementations based on the mode your application will be running in.
instructions.html wrote:// Locks a record so that it can only be updated or deleted by this client.
If you leave your lock/unlock methods empty in local mode I'm wondering how you will do this one, because that means you can't update/delete a record if it's not locked.
If the specified record is already locked, the current thread gives up the CPU and consumes no CPU cycles until the record is unlocked
OCMJEA, OCJP, OCJD, OCE SQL, OCP Forms Developer, OCP PL/SQL Developer
Roel De Nijs wrote:Again my question: if you always will return false from isLocked-method, how will you be able to update/delete a record if a lock on the record (you want to update/delete) is required prior to updating/deleting the record.
OCMJEA, OCJP, OCJD, OCE SQL, OCP Forms Developer, OCP PL/SQL Developer
Dmitry Kotlov wrote:And what about figures 3,4,5?
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |