• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Miscellaneous Questions

 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I am reaching the end of my project coding assignment (I think!) and would like to clarify some things.
My assignment is the B&S Contractors.
1. "The new application, using the existing data file format, MUST allow the CSRs to generate a list of constractors that match a customer's criteria. This is the project that you have been commissioned to implement."
I have implemented Case Sensitive and Insensitive searches for Name, Location, Specialty and Owner fields. I did not implement them for Rate and Size because they would be text field searches and be meaningless since these fields have a numeric value. Am I okay?

2. The program must be able to work in a non-networked mode. In this mode, the database and GUI must run in the same VM and must perform no networking, must not use loopback networking, and must not involve the serialization of any objects when communicating between the GUI and database elements.
I understand that loopback networking is when you use "localhost" as host name to connect to the same machine. I have access to just one computer, how can I test for this condition? When I put the IP address/machine name of my machine and try, it also works. If I give a non-existent host name, it does not connect. Am I okay here?
3. It must allow the user to search the data for all records, or for records where the name and/or location fields exactly match values specified by the user.
This sounds like some trick requirement. I have implemented searches for Name, Location, Specialty and Owner. Does this fulfil the requirement above? What do they mean by "search the data for all records"?

3. Are we allowed to change (not the code) DBAccess.java interface in any way? What I mean is, can I make changes to add javadoc comments, or should that file be left untouched even though the other files have comments?
4. Network Approaches
Your choice of RMI or serialized objects will not affect your grade, but no other approach is acceptable. In either case, the program must allow the user to specify the location of the database, and it must also accept an indication that a local database is to be used, in which case, the networking must be bypassed entirely.

I am confused about this one here, when I bring up my Server, it first shows a Configuration window where you enter the Port number and Database location. Then you bring up the Network Client in a different DOS window and it asks you for the host name and port number. Once you enter that, it brings the main client window up in the Networked mode. What do they mean by "it must also accept an indication that a local database is to be used"? Are they talking about the local client mode? Why does the Heading say "Network Approaches"?

Thanks!
Sanjay
[ March 17, 2004: Message edited by: Sanjay Joshi ]
 
Ranch Hand
Posts: 619
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sanjay,

Originally posted by Sanjay Joshi:
My assignment is the B&S Contractors.
1. "The new application, using the existing data file format, MUST allow the CSRs to generate a list of constractors that match a customer's criteria. This is the project that you have been commissioned to implement."
I have implemented Case Sensitive and Insensitive searches for Name, Location, Specialty and Owner fields. I did not implement them for Rate and Size because they would be text field searches and be meaningless since these fields have a numeric value. Am I okay?

Sanjay, you were OK after you had implemented the case sensitive search for name and location.
Those are the only required searches. Searching the other fields and the case insensitive search are all extras. They probably won't boost your score any, but on the other hand, if they work well they aren't going to detract from your score either.

2. The program must be able to work in a non-networked mode. In this mode, the database and GUI must run in the same VM and must perform no networking, must not use loopback networking, and must not involve the serialization of any objects when communicating between the GUI and database elements.
I understand that loopback networking is when you use "localhost" as host name to connect to the same machine. I have access to just one computer, how can I test for this condition? When I put the IP address/machine name of my machine and try, it also works. If I give a non-existent host name, it does not connect. Am I okay here?

Your quotation from the assignment instructions is talking about the non-networked mode (also known as standalone mode). So if you run in standalone mode, that is, "java -jar runme.jar alone" all by itself, "the database and GUI must run in the same VM and must perform no networking,
must not use loopback networking, and must not involve the serialization of any objects when communicating between the GUI and database elements." So if you meet all those requirements when your application is running in standalone mode, then you're OK.
You can test your client-server applications (that is, "java -jar runme.jar server" and "java -jar runme.jar") on the same machine. In this case you are testing both server mode and network client mode and since you are doing this on a single machine you are using loopback networking. But that's OK, it's only in the standalone case that you are prohibited from using loopback networking. It's really nice to be able to test your application on two different machines. If you can possibly borrow someone's portable computer it would be worth your while. That said, I did 95% of my testing on a single computer. The remaining 5% was done on two computers. I don't remember discovering any specific problems I discovered by using a second computer, but it made me feel a little more confident.
My advice is to package your project as you would before you submit it, create a new directory and install your application from your submission jar file according to your user's guide instructions and test the application in all three operating modes (so you'll have to install at least two instances). Also unjar your submission jar and make sure everything is there where it's supposed to be according to the very detailed packaging instructions included in the assignment instructions. I know of one person who had to pay a $150 resubmission fee just because he made a simple mistake in the packaging.

3. It must allow the user to search the data for all records, or for records where the name and/or location fields exactly match values specified by the user.
This sounds like some trick requirement. I have implemented searches for Name, Location, Specialty and Owner. Does this fulfil the requirement above? What do they mean by "search the data for all records"?

Again, you only needed to allow searches for name and location. What I believe they mean by "search the data for all records" is that using your search capability it should be possible for the user to retrieve all the records there are in the database file (except for the ones that are marked as deleted). How you do this is variable. For example, leaving all the search criteria fields blank and pressing the Search button might return to the JTable all the records in the database. Alternatively, you might make the user put a star (*) or "ANY" in all the search fields, press the Search button, and then the user will see all the records in the database appear in the JTable. (I think the first alternative is more elegant.) So assuming you allow the user to return all the records in the database and you allow the user to search for: a given name (only), a given location (only), and a given name AND location, then I think you're OK.

3. Are we allowed to change (not the code) DBAccess.java interface in any way? What I mean is, can I make changes to add javadoc comments, or should that file be left untouched even though the other files have comments?

Yes, you should change the format of the Sun interface comments to use the standard javadoc format. I would not change the content of the method comments, and as you say, I would certainly not change any of the code.

4. Network Approaches
Your choice of RMI or serialized objects will not affect your grade, but no other approach is acceptable. In either case, the program must allow the user to specify the location of the database, and it must also accept an indication that a local database is to be used, in which case, the networking must be bypassed entirely.

I am confused about this one here, when I bring up my Server, it first shows a Configuration window where you enter the Port number and Database location. Then you bring up the Network Client in a different DOS window and it asks you for the host name and port number. Once you enter that, it brings the main client window up in the Networked mode. What do they mean by "it must also accept an indication that a local database is to be used"? Are they talking about the local client mode? Why does the Heading say "Network Approaches"?

The description of your application operating in server and network client modes sounds exactly right. I think by "it must also accept an indication that a local database is to be used," means that you must allow the user to enter the command: "java -jar runme.jar alone" and if that happens then you must start your application in standalone mode which means that a local database will be used. When you start up your application in standalone mode it should allow you to specify the database location. (Aside: it's not required but it is a really nice thing to allow the user to use a JFileChooser when specifying the database location. Usually I'm an advocate of just meeting the requirements as simply as possible, but the JFileChooser is so neat and so little work, that I recommend people use it even though it's probably not required.)
So the answer to your question "are they talking about local client mode?" is yes. Why they choose to impart this pearl of wisdom in the midst of talking about "network approaches" is unclear. The answer might just be "because." Some parts of the assignment instructions seem to been well thought-out; other parts read like stream-of-consciousness dictation.


[ March 17, 2004: Message edited by: George Marinkovich ]
 
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sanjay, I will to answer the questions that am aware of.

Originally posted by Sanjay Joshi:
Hello,
I am reaching the end of my project coding assignment (I think!) and would like to clarify some things.
My assignment is the B&S Contractors.
1. "The new application, using the existing data file format, MUST allow the CSRs to generate a list of constractors that match a customer's criteria. This is the project that you have been commissioned to implement."
I have implemented Case Sensitive and Insensitive searches for Name, Location, Specialty and Owner fields. I did not implement them for Rate and Size because they would be text field searches and be meaningless since these fields have a numeric value. Am I okay?
[qb]
I think it is Okay. Actually I think we should co-relate this with the User Interface requirements and supply search functionality.

2. The program must be able to work in a non-networked mode. In this mode, the database and GUI must run in the same VM and must perform no networking, must not use loopback networking, and must not involve the serialization of any objects when communicating between the GUI and database elements.
I understand that loopback networking is when you use "localhost" as host name to connect to the same machine. I have access to just one computer, how can I test for this condition? When I put the IP address/machine name of my machine and try, it also works. If I give a non-existent host name, it does not connect. Am I okay here?

Sorry, I don't know. Maybe some networking experts will answer this.

3. It must allow the user to search the data for all records, or for records where the name and/or location fields exactly match values specified by the user.
This sounds like some trick requirement. I have implemented searches for Name, Location, Specialty and Owner. Does this fulfil the requirement above? What do they mean by "search the data for all records"?

There are many discussions on this particular requiremnt. I will try to tell what I understood from them. Most people provide search functionality in the following way. Allow CSR to do exact search, case-sensitive search for name and location fields. This they do by providing editable combo's or providing a check-box for exact matching. You did supply extra functionality than required like providing search by owner and speciality. What I did for for "search the data for all records" is that I provided a search all button at first. Later on George's suggestion, I thought it is redundant to provide if we allow CSR to search all(show) records by pressing the search button without entering any name/location in the text fields.

3. Are we allowed to change (not the code) DBAccess.java interface in any way? What I mean is, can I make changes to add javadoc comments, or should that file be left untouched even though the other files have comments?

The same issue was discussed a couple of days ago, I think. One of the instructions given to me is to provide javadoc comments for each element in a public interface. So I think we should add javadoc comments for this one also.

4. Network Approaches
Your choice of RMI or serialized objects will not affect your grade, but no other approach is acceptable. In either case, the program must allow the user to specify the location of the database, and it must also accept an indication that a local database is to be used, in which case, the networking must be bypassed entirely.

I am confused about this one here, when I bring up my Server, it first shows a Configuration window where you enter the Port number and Database location. Then you bring up the Network Client in a different DOS window and it asks you for the host name and port number. Once you enter that, it brings the main client window up in the Networked mode. What do they mean by "it must also accept an indication that a local database is to be used"? Are they talking about the local client mode? Why does the Heading say "Network Approaches"?

I think here they are talking about the local mode, becasue if we read the rest of line it cleary states that the network code must be bypassed entirely. So I think what they mean is when running in the local mode we must provide the indication of the local db.


Thanks!
Sanjay
[ March 17, 2004: Message edited by: Sanjay Joshi ][/QB]


Good Luck.
 
Satish Avadhanam
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, George already explained by the time I typed. Thanks George, I can also go through what you explained and understand them.
 
amchi gelo
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot George and Satish, looks like I am all okay here, I feel much better now!


(Aside: it's not required but it is a really nice thing to allow the user to use a JFileChooser when specifying the database location. Usually I'm an advocate of just meeting the requirements as simply as possible, but the JFileChooser is so neat and so little work, that I recommend people use it even though it's probably not required.)


My app already uses JFileChooser. However, I sometimes find that this is a bit slow, when you click on the button which is supposed to bring it up, it does not always pop up immediately. Is this something any of you encountered?
 
George Marinkovich
Ranch Hand
Posts: 619
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sanjay


My app already uses JFileChooser. However, I sometimes find that this is a bit slow, when you click on the button which is supposed to bring it up, it does not always pop up immediately. Is this something any of you encountered?


Yes it is a little slow, but not slow enough to cause me any concern. I think the user will appreciate the ease of clicking on a file rather than having to type in a path and file name. I don't think the user will begrudge a little delay before the JFileChooser appears. It's worth the wait.
[ March 17, 2004: Message edited by: George Marinkovich ]
 
amchi gelo
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A submission question.
When I make the JAR file, and upload it, what should the filename be? Can it be anything? I didnt find any guidelines on that.
 
Satish Avadhanam
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sanjay

Originally posted by Sanjay Joshi:
A submission question.
When I make the JAR file, and upload it, what should the filename be? Can it be anything? I didnt find any guidelines on that.


If you are asking about JAR file name, then here are the instructions from mine:


The executable JAR containing the programs. This must be called runme.jar


Good Luck.
 
George Marinkovich
Ranch Hand
Posts: 619
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sanjay, Satish,
What Satish says is true, but I think Sanjay was asking a slightly different question.
I think this might help: Topic: (NX,URLyBird)About submission packaging
 
Satish Avadhanam
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey George thanks for the info. I have just gone through the thread.
So we need to check on the site before submitting and accordingly name the jar file.
 
amchi gelo
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I looked at the thread that George pointed to and logged in and this is what it said.
"Upload instructions for the Java 2 exam:
Submitting Your Work
When you have completed your solution, you should build a jar archive. You must build an archive; do not send individual files.
The name of your submission archive file MUST be derived from your Testing ID, as shown above. Your Testing ID is your 9-digit Social Security Number (U.S. only), or it might be another alphanumeric combination, e.g. sp1234567 (any country). Your archive filename MUST BE scjda-AAAAAAAAA.ZZZ, where AAAAAAAAA is your Testing ID, and ZZZ is the appropriate filename extension for your archive type (zip, tar, or jar).
If you have prepared your archive, please press the 'Continue' button."
However, everybody please login and check for themselves, it might just be different.
Thanks George, you rock!
 
amchi gelo
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay, another 'little' issue I came across.
My searches on Name and Location use the 'startsWith' method so that matches are from the beginning of the field.
What about Specialties? I just realized that I had used the same idea, but its kind of meaningless since multiple specialties for a contractor are separated by a comma.
Any ideas?
 
George Marinkovich
Ranch Hand
Posts: 619
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sanjay,

Originally posted by Sanjay Joshi:

My searches on Name and Location use the 'startsWith' method so that matches are from the beginning of the field.
What about Specialties? I just realized that I had used the same idea, but its kind of meaningless since multiple specialties for a contractor are separated by a comma.


The first thing to point out is that you are not required to provide the search capability for fields other than Name and Location. So you don't really need to worry about Specialties. Providing the search capability for Specialties is extra so the way you are doing it (treating it like every other database field) is perfectly fine.
To go way beyond the requirements of the project (which I can't recommend anyone do) you could build additional complexity into the find method implementation. My find method breaks each database field into subfields. The subfields are split by comma. If the search string matches any of the subfields of a database field, then it is considered to match the entire database field. Given the data we received in the database file, this subfields concept only seems to apply to the Specialties field.
Here's how it works: if the user queries the Specialties field for Painting, then they would match the following records:
Specialties
Painting
Painting, Electrical, Drywall
Drywall, Painting, Electrical
Drywall, Painting
Again, there's no requirement to do this so I can't recommend that anyone else should do it. If you think about how a CSR would really need to use the application this would be a very nice feature, but it's absolutely not required.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic