Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

[B&S]UI does not require some methods in DB ?

 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am working on 2.1.3

UI requirements include:
*It must allow the user to search the data for all records
*It must allow the user to book a selected record, updating the database file accordingly
...
did not say 'create', 'modify' and 'delete' the contractors. But the DB interface which is required to implement has these methods:
public void delete(int recNo, long lockCookie)
public void update(int recNo, String[] data, long lockCookie)
public int create(String[] data) throws DuplicateKeyException;

a thread discuss this before

I think the update method is for update contractor, not for booking. I can use it for booking though. Then I only need to implement 'update' method, which is the only method need lock. Isn't it too simple for this project ?


The description for the "Customer holding this record" field says "The system you are writing does not interact with these numbers". So I do not need to search by this field, then how can I unbook a record without checking who booked this record first ?



Any idea ?
 
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by K Huang:
I am working on 2.1.3

UI requirements include:
*It must allow the user to search the data for all records
*It must allow the user to book a selected record, updating the database file accordingly
...
did not say 'create', 'modify' and 'delete' the contractors. But the DB interface which is required to implement has these methods:
public void delete(int recNo, long lockCookie)
public void update(int recNo, String[] data, long lockCookie)
public int create(String[] data) throws DuplicateKeyException;

a thread discuss this before

I think the update method is for update contractor, not for booking. I can use it for booking though. Then I only need to implement 'update' method, which is the only method need lock. Isn't it too simple for this project ?


The description for the "Customer holding this record" field says "The system you are writing does not interact with these numbers". So I do not need to search by this field, then how can I unbook a record without checking who booked this record first ?

Any idea ?



Even though the client will not be using create, delete, etc. we are still required to fully implement the entire interface for future use with the software. Unbook is not required for this assignment. I don't think you would get any extra points for implementing it. So even though you might be using book and update, implement the entire interface.
 
K Huang
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for reply !

If no unbook and no create in UI, then after about 33 books (my database has about 33 records, the database is fully booked and cannot be used any more. What kind of system is this ?
 
Ranch Hand
Posts: 581
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by K Huang:
...then how can I unbook a record without checking who booked this record first ?



Any idea ?



My solution was: keep a record number for every record, then you can unbook a certain contractor by its record number.
 
Ranch Hand
Posts: 1033
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by K Huang:
Thanks for reply !

If no unbook and no create in UI, then after about 33 books (my database has about 33 records, the database is fully booked and cannot be used any more. What kind of system is this ?



My solution to this is that I have a "pkw.test" package that adds a lot of extra functionality that isn't in the "suncertify.*" packages. One of the programs in my test suite is a maintenance program that allows create, delete, update and unbook actions as well as things like pausing after locking a record. This lets me test all the possible actions and use them when a normal client is trying to search and book records.

Since it's in a different package collection, it doesn't get built by my ANT script into the runme.jar, but goes instead into a test.jar file that contains it and a bunch of other test programs, such as a lock tester that runs many threads against the locking code.

All of this is useful if you want to get "coverage" testing. I use Emma for coverage testing since I don't use any of the heavy IDE's, but this sort of stuff is needed for any form of coverage testing.
 
Whoever got anywhere by being normal? Just ask this exceptional tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic