• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

create() and delete() usage

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
everyone.
I have a question concerning the function of my application,the DB interface in my assignment has create() and delete() methods.But the user interface I think only has the find and book function(There's no rights for the end user to create or delete a record from the database I think).So when and where create() and delete() methods can be used?(On the server side? May be on the server side GUI? But it is not required.)
Hope anyone help me.
Thanks.
 
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mingwei,


I have a question concerning the function of my application,the DB interface in my assignment has create() and delete() methods.But the user interface I think only has the find and book function(There's no rights for the end user to create or delete a record from the database I think).So when and where create() and delete() methods can be used?(On the server side? May be on the server side GUI? But it is not required.)


You do not need to think that much. In fact, in my implementation, there is NO clients or system admin who will call the 2 methods.
So, what you need to do is, implement the 2 methods, test them, that's it. You do not need to provide these 2 methods to the client or anyone else.
Remember, you NEED to implement ALL methods define in SUN's interface class, but NOT ALL of them will be used. According to the insturctions, the only methods that will be invoked by the clients are BOOK() and SEARCH().
The instruction also mentions that, providing EXTRA functionality will not let you obtaining bonus point, but, marks will be deduced if error encountered in the extra functions.
Nick.
[ February 24, 2004: Message edited by: Nicholas Cheung ]
 
Mingwei Jiang
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Nicholas! I'll do my best to fulfill this assignment.
 
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also think that there are only 2 use cases for my assignment(B &S).
- search facility
- booking facility
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just to hijack this thread a little (it is relevant - honest!). What is the point of having the delete flag? If you want to delete a record why not just delete it rather than changing the 2 byte flag? I don't understand why you would wany lots of deleted records cluttering up the database file?
Stephen
 
Ranch Hand
Posts: 619
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Stephen,

Originally posted by Ste Graham:
Just to hijack this thread a little (it is relevant - honest!). What is the point of having the delete flag? If you want to delete a record why not just delete it rather than changing the 2 byte flag? I don't understand why you would wany lots of deleted records cluttering up the database file?


Two reasons:
1) To correctly implement the delete method given in the Sun-supplied interface:

It says it marks a record for deletion (and makes it available for reuse), not that it physically removes the record from storage.
2) Marking a record for deletion is much easier (and faster) than physically removing the record. The create method is supposed to reuse records marked for deletion if there are any. So in a situation where there are more creates than deletes, there won't be any deleted records cluttering up the database file. Maybe the legacy application has a compact capability that physically compresses the size of the database file removing any records marked for deletion. Under those circumstances the customer didn't want to waste your valuable time implementing the same capability in your application.
 
A magnificient life is loaded with tough challenges. En garde tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!