• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

deleted flag...

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
< User Interface >
* It must allow the user to book a selected record, updating the database
file accordingly.

Does "updating" mean that I change the delete flag to 1?
ok - then,
----------------------------------------------------------------
package suncertify.db;
public interface DB {
...
public void delete(int recNo, long lockCookie)
throws RecordNotFoundException, SecurityException;
}
----------------------------------------------------------------

Since we have to think about scalability, there is a delete (),
in this delete case, let's assume we set the delete flag to 1.

Now, how we perceive this 1 in a data file from booking or deletion?

this flag is used for find(), which means the flag is set to 1, don't show
it into table, then yet another problem occurs, from ambiguous distiction,
from booking or deletion?

I think about set the value 2 for booking but then the definition of
flag fades out, doesn't it? flag 0 or 1.

Let me know the good insights.
Thanks -
 
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


It must allow the user to book a selected record, updating the database
file accordingly.



A record is considered booked when the field owner is set to a non-empty String. Therefore, the expression "updating the the database accordingly" would imply updating the value of that column in the database.

This, as far as I am concerned, has nothing to do with the delete flag, except for the fact that the updateRecord method is responsible for making sure that the record is not deleted at the moment of performing the operation.

However, the update should not alter the value of the delete flag at this time, because if the record is deleted it should throw RecordNotFoundException.

The value of the delete flag gets altered by two different methods, according to my specs:

1) A record is set to deleted when the deleteRecord method is invoked on it.

2) A record is set to non-deleted when the createRecord is invoked and there is a deleted record that can be reused instead of adding new records to the database.

As for the findByCriteria method, it is not supposed to throw any specific checked exception, therefore you will have to create a mechanism to by-pass the deleted records while going over the whole file, searching for the provided criteria. In my case I have a method named somewhat like isRecordDeleted that evaluates the deletion flag on a record.
[ October 26, 2006: Message edited by: Edwin Dalorzo ]
 
paul seldon
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since this instruction doesn't ask to implement delete and create, although the interface has those, can I left those empty as in interface.
 
Edwin Dalorzo
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The GUI specification does not require the implementation of anything but hotel room booking.

However, the server side is another story. The DBAccess interface clearly states it should be implemented. Therefore you will have to provied implementations for all its methods.

I do not believe that throwing UnsupportedOperationException be an option. And I have not heard of anybody who has not implemented it.

So, be careful with this assumption.
reply
    Bookmark Topic Watch Topic
  • New Topic