This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes B&S: How to handle the number of workers available in a record? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "B&S: How to handle the number of workers available in a record?" Watch "B&S: How to handle the number of workers available in a record?" New topic
Author

B&S: How to handle the number of workers available in a record?

Darya Akbari
Ranch Hand

Joined: Aug 21, 2004
Posts: 1855
Dear all

I need some clarification on the following statement from my assignment:

Bodgitt and Scarper ... offer the homeowner one or more contractors that can provide the required services ...


What does it mean exactly

I first thought that each one record from my data file describes one contractor. In that case I would allow the user of my application to select multiple records from the GUI view. I would not care about the number of workers available in the records.

But now, the size field comes into my eyes where the assignment says:

The number of workers available when this record is booked


Think that a contractor has 10 workers to offer for a specific location and a user want to book that contractor. Does this user then has to book the whole bunch of 10 workers or should he be able to book only 5

Any hints are welcome :roll:

Regards
Darya


SCJP, SCJD, SCWCD, SCBCD
Frans Janssen
Ranch Hand

Joined: Dec 29, 2004
Posts: 357
Hi Darya,

I have interpreted the requirements such that a client books records. I did not do anything with the number of workers, except display it in the JTable.

Frans.


SCJP 1.4, SCJD
Darya Akbari
Ranch Hand

Joined: Aug 21, 2004
Posts: 1855
Hi Frans,

then how did you interpret

Bodgitt and Scarper ... offer the homeowner one or more contractors that can provide the required services ...


Did you allow the user to select multiple records and book them in one bunch for convenience or did you allow one record to be selected and booked?

Regards,
Darya
Frans Janssen
Ranch Hand

Joined: Dec 29, 2004
Posts: 357
Originally posted by Darya Akbari:
Did you allow the user to select multiple records and book them in one bunch for convenience or did you allow one record to be selected and booked?


I did indeed make it so that multiple records could be booked in one bunch. Although I think that the requirement is still fulfilled even if multiple clicks are needed: the CSR can still book multiple contractors for one customer.

Frans.
Darya Akbari
Ranch Hand

Joined: Aug 21, 2004
Posts: 1855
I think a single select should be also fine. Otherwise one has to popup a new window to enter the owner id for all selected records, which I think is too much and not necessary for this assignment.

At least I hope it's not necessary

Regards,
Darya
Frans Janssen
Ranch Hand

Joined: Dec 29, 2004
Posts: 357
I had a text box in the main window where the customer ID could be entered. The records were displayed in a JTable (of course), which I configured in multiple select mode.
Then if the book button was clicked, all selected records would be booked for the enetered customer ID.

So the user does not need to enter a customer ID for each separate record.

Frans.
Darya Akbari
Ranch Hand

Joined: Aug 21, 2004
Posts: 1855
I think I will steel that idea from you

Thanks,
Darya
Paul Bourdeaux
Ranch Hand

Joined: May 24, 2004
Posts: 783
Hi Darya,

I implemented my project in the same way as Frans, although I did not allow for multiple clicks (It is fairly easy to implement easy way, this was just a design decision on my part). A customer can book as many contractors as he or she wants, but has to book them one at a time. I did have the customerID persist in the JTextBox when the user selected a new record so they wouldn't have to keep on entering it though.


“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.” - Rich Cook
Darya Akbari
Ranch Hand

Joined: Aug 21, 2004
Posts: 1855
Hi,

where did you guys placed the owner JTextBox?

I was actually allowing the user to select the row and to edit the owner column but I think your approach is cleaner, since you use the JTable only for presentation and keep the control seperate.

Or what do you think of my approach?

Regards,
Darya
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: B&S: How to handle the number of workers available in a record?