File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Deleting/adding records.

 
Peter Kovgan
Ranch Hand
Posts: 84
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From Bodgitt and Scarper:
"...Any methods that throw RecordNotFoundException should do so if a specified record does not exist or is marked as deleted in the database file.... "
And no word more about deleting or adding records.
Should I allow to user add/delete records?
 
Bigwood Liu
Ranch Hand
Posts: 240
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
The user? Who is the user? If the user is a server, yes; if the user is a client, no.
Best,
Damu
 
Peter Kovgan
Ranch Hand
Posts: 84
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please, explain me:
What I should do, separate "server administration" to delete/add records?
 
Bigwood Liu
Ranch Hand
Posts: 240
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. the server have the right to add/delete a record.
2. a deleted record has a special flag at the beginning of the record. From the instruction.:
2 byte flag. 00 implies valid record, 0x8000 implies deleted record
So if you find that the record is deleted or doesn't exist at all, you throw the exception.
3. you implement the add/delete methods in Data class.
4. you may never use these methods unless you decide to provide the functions beyond the instruction of suncertify
 
Peter Kovgan
Ranch Hand
Posts: 84
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much,Damu Liu!
I understand .
Can you help me with one question:
How to hide public methods of Data.class(lock(),unlock()) from client?
I want to keep encapsulation and allow access to these methods only from
another methods(bookRecord() for example).
I feel - answer is simple, but have no idea.
Extend Data.class by another class and call super.lock()?
[ October 26, 2003: Message edited by: Peter Kovgan ]
 
Bigwood Liu
Ranch Hand
Posts: 240
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi please see this topic endless discuss
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic