Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

SCJD Questions

Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I'm having some trouble fully understanding my assignment (B&S). Maybe this is because English is not my mother tongue... Your views will be highly appreciated. Thanks for taking time to read all this.

These are my questions (I'm sorry I have too many questions):

1 - Required interface

"Your data access class must be called "", must be in a package called "suncertify.db", and must implement the following interface:
package suncertify.db;
public interface DBMain {..."

I believe this requirement exists "because the data must continue to be manipulated for reports using another custom-written application..."

While I'm planning to have a implementing DBMain, am I forced to interact to the database using the DBMain interface? Because I could make to implement the required interface to keep compatibility with the custom-written applications plus another interface that will be more convenient for the way I want to implement the solution. One of the limitations I perceive is detailed in 2.

2 - The find method

"// Returns an array of record numbers that match the specified
// criteria. Field n in the database file is described by
// criteria[n]. A null value in criteria[n] matches any field
// value. A non-null value in criteria[n] matches any field
// value that begins with criteria[n]. (For example, "Fred"
// matches "Fred" or "Freddy".)
public int [] find(String [] criteria)
throws RecordNotFoundException;"

According to my point of view, this makes little sense for the specialties field: if the user of the interface tries to find "Glass" in a field that contains "Air Conditioning, Glass" he/she won't get the record. Am I understanding this properly? I thought of using the just to read and persist the data from my business layer, but implementing the data cache and search in it to decouple my implementation from the old database.

3 - GUI

"It must present search results in a JTable."

According to what I've been reading, most of the people implemented the solution using just a JTable to show the information to the end users. Here also the specialties issue makes things more complicated. The overview section states: (CSRs) "take requests from home owners for a type of service, and offer the homeowner one or more contractors that can provide the required services".
For me, it makes sense if the CRSs are able to find companies that can provide the required service or services (maybe restricting the search to a specific city). I feel this is the natural for the CRSs to find the information they need.

I thought of implementing the GUI like this:
- a JTable that shows all the contractor's information but the specialties field
- a JPanel with the complete information for the customer including a JList with the sorted set of the specialties. This panel would be linked to the JTable: selecting a row in the table would update the contents of the panel accordingly. This panel could also be used as a search panel, and the results of the search would update the JTable.

4 - Booking

From the business point of view the booking of the contractor does not make sense for me. I understand that the client can book for a contractor and while it is booked nobody else can receive services from the same contractor. Am I getting this right? If a contractor has 50 employees and I want to paint my small bathroom... will the contractor be impeded to service another client until it is finished with my bathroom?

I don't want to fail the assignment for not understanding it properly. I'm sorry if I'm not very clear with presenting my ideas... please contact me if you feel you need more information or you need me to explain my point of view in a different way.

Again, thanks a lot for helping me with this...

Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Marcelo,

I can only answer yout first question (I did UrlyBird).

am I forced to interact to the database using the DBMain interface

For example: you can make a new interface that extends the DBmain interface (add some methods that you want), and have implement that new interface. And you GUI will use the extra methods you added.

Marcelo Ruiz
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for answering Herman. That's what I thought, but I wanted to be sure...
Yes, of course, and I accept that blame. In fact, i covet that blame. As does this tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic