• 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
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

About URLyBird 1.2.3 Assignment Question

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I feel shame to say that I haven't finished my assignment yet, since last year March. There are many reason I can tell you if you ask me why. The reason such as: I changed my job; I am too busy on work; My english writing is not good enough to tend the essay exam; etc.

Anyway, I have to submit my assignment finally. So, I hope you can help me to understand the problem which I have as follows:


1. In my instructions, it says:
"It must allow the user to book a selected record, updating the database file accordingly"
I don't know why??? If a record seleted by the user, which have been booked by some customer, the record should not be book again, I think.

2. Must I implement all method which extends from DBAccess interface in Data class? I mean if I have to write some code into the "createRecord" method which would never been invoked by other object?

3. What does the "DuplicateKeyException" class mean? In other words, what's Key mean? Is it including all the field? Or it is just the hotel name?

4. In my instructions, it says: "Any unimplemented exceptions in this interface must all be created as member classes of the suncertify.db package". I found that the "SecurityException" already exist in package "java.lang". So, if I needn't to create a new "SecurityException" in package "suncertify.db"

5. In my instructions, it says: "Architecturally, In Non-Networked Mode, It must use the database and GUI from the networked form, but must not use the network server code at all.". But I think it is better to say that: "Architecturally, In Networked Mode, It must use the database and GUI from the non-networked form, and must use the network server code. Am I right??

6. As to comments in each class, I have no idear at all. could anyone give me advise?


Thanks you all your advise.
 
Jesse Xie Y.S.
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
P.S.


According to the Data File Format Specification.
I would check the data standard schema before I use the file specified by Configuration GUI. But should I check the 4 byte numeric, magic cookie value which identifies a file as a data file in the file?
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jesse,

I feel shame to say that I haven't finished my assignment yet, since last year March.



I think the maximum I have heard so far, was one candidate who took 6 years to complete his assignment (change jobs, move house, get married, have babies ...). So one year is certainly nothing to be ashamed of .

My english writing is not good enough to tend the essay exam; etc.



I wouldn't worry about that so much - your English writing here is understandable, so the assessor should be able to understand it. Just something for you to think about: even though it is called an "essay exam", theoretically you do not need to write an essay (worrying about grammer and tense and all the other icky bits of the English language). Some candidates find it easier to answer the four questions in "bullet point" format, which makes the sentences easier to construct / read.

1. In my instructions, it says:
"It must allow the user to book a selected record, updating the database file accordingly"
I don't know why??? If a record seleted by the user, which have been booked by some customer, the record should not be book again, I think.



Correct - you are going to have to do validation to ensure that the record the user has chosen is still available to be booked, and give an error message if the record is no longer available.

Remember that your instructions tell you that "This document deliberately leaves some issues unspecified, and some problems unraised."

2. Must I implement all method which extends from DBAccess interface in Data class? I mean if I have to write some code into the "createRecord" method which would never been invoked by other object?



It is possible to pass without implementing the create or delete methods. However to do so, you need to do several things:
  • Have the remainder of the assignment almost perfect.


  • You might loose points for not implementing these two methods. Plus the implementation of the create and delete methods can affect the points available in your locking class. So you would really want to hope that you do not loose points elsewhere.
  • Explain very clearly in your choices document and in the source code itself why you chose not to implement the methods - (and hope that the assessor accepts your reasoning - if you do it really well, the assessor might not take points of for the items I mentioned earlier). Do you have a good reason for this (other than you just want to get the assignment finished in as short a time as possible)?
  • Decide what is reasonable to do if someone does call your methods.


  • 3. What does the "DuplicateKeyException" class mean? In other words, what's Key mean? Is it including all the field? Or it is just the hotel name?



    If you do a search in this forum for DuplicateKeyException you will find many posts on this subject.

    I personally would think that hotel name is not suitable for a primary key - each hotel may have many rooms, and each room may be available over many nights.

    4. In my instructions, it says: "Any unimplemented exceptions in this interface must all be created as member classes of the suncertify.db package". I found that the "SecurityException" already exist in package "java.lang". So, if I needn't to create a new "SecurityException" in package "suncertify.db"



    Take a look at the description of java.lang.SecurityException - do you think that the description matches your needs?

    Have you noticed that java.lang.SecurityException is a RuntimeException? Do you really want that?

    5. In my instructions, it says: "Architecturally, In Non-Networked Mode, It must use the database and GUI from the networked form, but must not use the network server code at all.". But I think it is better to say that: "Architecturally, In Networked Mode, It must use the database and GUI from the non-networked form, and must use the network server code. Am I right??



    Yes, that sounds reasonable.

    6. As to comments in each class, I have no idear at all. could anyone give me advise?



    I'm sorry, I don't understand what sort of advice you are looking for. Are you asking about JavaDoc comments, or other comments? Are you asking about what sort of information to put in the comments? Are you asking about what you can leave out? Or something totally different?

    According to the Data File Format Specification.
    I would check the data standard schema before I use the file specified by Configuration GUI. But should I check the 4 byte numeric, magic cookie value which identifies a file as a data file in the file?



    I would (and did) check the magic cookie value as the very first step before doing anything else with the file.

    Regards, Andrew
     
    Jesse Xie Y.S.
    Greenhorn
    Posts: 20
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Dear Andrew, Thank you so much for your very kind, and very excellent reply. Exactly, you give me the clear answer and encourage me by a long way. I feel very good now.

    At first, I am sorry for the question 6. It puzzled me too, when I read it by myself. Maybe, my question should be described as follows:


    I have no idear about the comment in each java file header. I have looked into some java file in the runtime libaray package. They just look like:

    /*
    * @(#)Runme.java 1.1.1 2004-5-15
    *
    * Copyright (c) 2004 Sun Certification for Java Development.
    * All Rights Reserved.
    */

    It's my choice about such comments. Is it OK?



    So, I hope I can know the one candidate who took 6 years to complete his assignment. He must be a very brave man .

    And I will answer the four questions in "bullet point" format. It's easier for me.

    About question 1. My decision is that: It does not allow the user to book a selected record, which have booked by one customer in the same GUI. It will throws exception message when the user try to book a selected record, which have booked by one customer in other program GUI. User can get the last booked record list by using Search All function.

    About question 2. My decision is planing to implement the createRecord and deleteRecord method. Because I didn't have a good reason for this, and I don't want to finish my assignment as soon as possible again after I heard someone took 6 year to complete his assignment, also, I have get a new voucher for my essay exam which expired date is in November this year .

    But, if so, I think there must be some good tools for testing such method like createRecord and deleteRecord which will never be invoked by other object in URLyBird program. Would you like to give me some?

    About question 3. It must make decision by myself, I think. And it's very hard to make a decision for such thing after I totally think about it (But it is easier than making a decision that which one should I marry to). But I didn't have decision about it now. I think I should analyse the original data in the assignment. I will post it as soon as I make a decision.

    About question 4. The answer is clear now. Because the SecurityException be throws by some method already, and the java.lang.SecurityException is a runtime exception, no need to throws it.

    About question 5. I just create a Service interface. It include Book & Search method. And there are two class implement it: ServiceImpl that maintain a Data object directly, and ServiceProxy that maintain a RemoteServiceImpl implemented by RMI which maintain a ServiceImpl instance, So ~~OhOh ~God . In other words, client GUI just only need to interact with Service interface, when program mode is non-network, just create a ServiceImpl instance for GUI, when program mode is network, just create a ServiceProxy instance for GUI. Am I right? Am I clear?

    And so, check the magic cookie value for validating a data file specified by user, is must option. And it's very important too.


    By the way, I have more and more question later.

    Thanks again!!!
     
    Andrew Monkhouse
    author and jackaroo
    Posts: 12200
    280
    Mac IntelliJ IDE Firefox Browser Oracle C++ Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi Jesse,

    I have no idear about the comment in each java file header. I have looked into some java file in the runtime libaray package. They just look like:

    /*
    * @(#)Runme.java 1.1.1 2004-5-15
    *
    * Copyright (c) 2004 Sun Certification for Java Development.
    * All Rights Reserved.
    */

    It's my choice about such comments. Is it OK?



    These comments are recommended by Sun (they are useful when dealing with information inserted by revision control systems / always having information in one location. But they are not necessary.

    But, if so, I think there must be some good tools for testing such method like createRecord and deleteRecord which will never be invoked by other object in URLyBird program. Would you like to give me some?



    I wouldnt. But others here might . If you open a separate topic that only talks about testing these two functions then you might get some guidance. In general you are more likely to get guidance than fully functional test programs, however if you search this forum you will find some examples have been posted in the past.

    About question 5. I just create a Service interface. It include Book & Search method. And there are two class implement it: ServiceImpl that maintain a Data object directly, and ServiceProxy that maintain a RemoteServiceImpl implemented by RMI which maintain a ServiceImpl instance, So ~~OhOh ~God . In other words, client GUI just only need to interact with Service interface, when program mode is non-network, just create a ServiceImpl instance for GUI, when program mode is network, just create a ServiceProxy instance for GUI. Am I right? Am I clear?



    I can see where you are going with this, and it will work. You could also look at using the Factory pattern to hide which particular class is being called - take a look at that pattern and see if it makes sense for what you are trying to do.

    By the way, I have more and more question later.



    You might want to consider whether they belong in this topic, or whether you should create new topics for each question. Sometimes you will not get an answer on such a long post as this, simply because people dont want to spend so much time answering so many questions.

    Regards, Andrew
     
    Climb the rope! CLIMB THE ROPE! You too tiny ad:
    We need your help - Coderanch server fundraiser
    https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
    reply
      Bookmark Topic Watch Topic
    • New Topic