Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!

Maksim Golubkow

Greenhorn
+ Follow
since Jun 04, 2003
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Maksim Golubkow

Thanks Philippe,
The notofication technique depends on your design.
I have very, very, very simple design.
So for my design the use of notify()/notifyAll() in the lock method was an absolute nonsense. In the unlock() method I have used notifyAll().
Regards,
Maksim
16 years ago
Thanks everybody for answering my questions.
General Con: 100 80
Documentation: 70 63
OOD: 30 27
GUI: 40 38
Locking: 80 80
Data Store: 40 40
Network Server: 40 40
Total: 400 361
Best luck to comming SCJD.
Best regards Maksim Golubkow
16 years ago
Nathaniel, You are not alone.
I have uploaded (I think I have uploaded) my assignment on sunday and run into the same problem as You. The worst is that I have done today my essay exam without to know whether the upload was successful or not.
I have send a mail to Prometric and get an auto reply that they are out of office. When I get the reply from Prometric I will post it here.
Regards,
Maksim
Thanks shan, that helps me.
Regards, Maksim
17 years ago
Hi shan, thanks for reply, but what i mean is following:

Regards, Maksim
17 years ago
Hi shan,
Congratulations, well done.
One question, have you data validation (such as owner id must be 8 digit number) in the methods updateRecord(...) and createRecord(...)?
Regards, Maksim
17 years ago

It is better than throwing a generic RuntimeException, but it is still not a checked exception. And this could mean that a client application could die a horrible death even though the programmer coded to specified interface.


You mean that folowwing code

is coded to the specified interface? This code would compile but don't run.
The question is: What is the specified interface?
Is it only the method signature or not? In my opinion it is not. It is the method signature and the data format (or the range of the data you could provide as parameter) especially if you use such general types as String/int/...
Regards, Maksim
[ July 09, 2003: Message edited by: Maksim Golubkow ]

Originally posted by Andrew Monkhouse:

  • You cannot throw a checked exception if something fails to validate - I dont think a RuntimeException is the correct response to invalid data.



  • What about java.lang.IllegalArgumentException?

    From javadoc:
    Thrown to indicate that a method has been passed an illegal or inappropriate argument.


    I think we have to validate the data passed to methods createRecord(...) and updateRecord(...). If we don't do it, it wold be very easy to destroy the data file. For example somebody could use our Data class to store "A" or "B" in the smoking field instead of "Y"/"N" as required by the spec and so change the format of the record, what is not allowed.
    To rate validation:

    Hope this helps!
    Regards, Maksim
    [ July 09, 2003: Message edited by: Maksim Golubkow ]
    Hi James,
    I'm also doing URLyBird but version 1.2.2.
    I think we have to validate the parameter data in the methods updateRecord(...) and createRecord(...). If we don't do it, it could be possible for example to write "01-01-2003" in the field date and so it will break at least one requirement

    ..., but because the data must continue to be manipulated for reports using another custom-written application, the new system must reimplement the database code from scratch without altering the data file format.


    Regards, Maksim

    Originally posted by Ta Ri Ki Sun:


    Alright then Maksim, given that, your clients can change the date and book rooms in advance or in the past, its a small hole, but better to plug it.


    I can't solve all problems of the world in my assignment.
    Regards, Maksim
    I have decided to implement the business logic on the client side, although I personaly prefer the thin-client architecture.
    Regards, Maksim

    so your server returns these, but surely your server doesn't need these sent back to it in order to book a room right?


    Why not? Allowing to send it back gives me possibility to detect concurent data modifications. BTW my RoomRecord objects are immutable.

    which "current system date" is that

    It depends where it called because it does nothing else as But I will move this methods to another class. RoomRecord objects are value objects and so the business logic has nothing to do there.

    Originally posted by Ta Ri Ki Sun:

    well my database server doesn't know business rules, so methods like bookRoom must be implemented and these rules must be considered, now if bookRoom is called in remote connection, and the _stub Adapter simply creates a new Date to compare to, then that would be the clients current system Date, so while the server doesn't know the business rule I felt it needed to provide its current date to compare against.
    This was actually a bug I found when testing my remote clients, the clients could change their dates and book rooms, but remember your Data class should only update, only rules it should care about are valid parameters, and update no matter what.


    Does it mean that your server/remote class has a method named bookRoom(...)? The name of the method sounds to me like a business operation or use case and therefore I would say you have to implement the business rule in this method.
    (Sorry if I have misunderstood something. English is not my native language.)
    Regards, Maksim

    Thanks Andrew, I'm doing version 1.2.2 and there is no RecordNotFoundException in the throws clause.
    Regards, Maksim
    Hi TQ,
    my first search implementation has returned all room records. But after deciding to convert field values to appropriate types (int, boolean, java.util.Currency, double and java.util.Date) I have thought it would be nice to filter out all records that the user may be won't see. But after rereading the spec and the reply from Mark I have decided to left it as is.
    Why we should convert field values to appropriate types? Have you planned some internationalization in your GUI (using ResourceBundle)? If so, than I would say that you could internationalize your GUI only to the half. Why? The date format in German for example is dd.mm.yyyy and not yyyy/mm/dd. Peoples in German would also prefer to see rates as $220,05 and not $220.05 (the last could be interpreted in German as twenty two thousand and five).
    To date validation:
    I have a class RoomRecord. The objects of this class will be returned from the server as a search result. There are two methods isBookable() where I'm going to implement the 48 hour rule. The conventional implementation will use the current system date to validate the date of the record. The second will use a parameter that represents the current system date.
    Why you not recommend to implement it on the server side?
    Regards, Maksim
    Hi TQ,
    here is my instructions of the unlock method:

    Releases the lock on a record. Cookie must be the cookie returned when the record was locked; otherwise throws SecurityException.


    What exception should be thrown if the record was not locked before? My first implementation has thrown IllegalStateException with the message "The record was not locked by lock(...) method!" to force the user of my API to write good code.
    Regards, Maksim