• 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

FBNS beginner.. help!!!

 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I have been given FBNS.
Should I start my SCJD assignment with GUI or the server side? Also I see in the class files(Data) given to me some methods like modify, add, and many more. What are these methods for?
Are they sufficient or do I need to add more methods (from a remote interface)to get the flight availability (based on SQLquery),updating seats available, passenger details etc? Please help. I'm confused.
 
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 Nandini

Should I start my SCJD assignment with GUI or the server side?


Which are you more comfortable with?
Personally I started with the GUI for two reasons:
  • When I started I was not sure how I was going to handle networking (RMI or Sockets) and I wanted more time to research and think about design issues with either choice.
  • I wanted to see something on the screen to show me that I was doing something
    I think you will not have problems doing either one first.

    Also I see in the class files(Data) given to me some methods like modify, add, and many more. What are these methods for?


    You will probably be calling the modify() method when you attempt to book a flight. Hopefully the usage of the Read(), Lock(), Unlock() methods also make sense in terms of the project.
    The create() method was used in an earlier version of the Fly By Night Services application, where candidates where given a plain text file containing the flight details and had to populate the database themselves.
    The Create and Delete methods are still there (I believe) because that way standard database functions (CRUD: Create, Read, Update, Delete) will all be available once you have finished your server. When developing client applications, extreme programming would suggest that you do not include anything you dont need right now ( YAGNI: You Aren't Gonna Need It). However for server side this principal does not always apply: it can be better to have basic functionality incorporated into a server now, that way there is less chance of the common server needing to be changed in the future (with it's associated problems of testing against all possible clients, and downtime while the server gets updated).

    Are they sufficient or do I need to add more methods (from a remote interface)to get the flight availability (based on SQLquery),updating seats available, passenger details etc?


    You do need to add code for the lock() and unlock() methods, and you have to create the criteriaFind() method as described in your instructions.
    Once you have done that, then you can write the entire application using only the methods in the Data class. You do not have to create any other methods for accessing the database.
    Some people here have added methods to provide added functionality to the database to make their client code simpler, or to improve performance. It is up to you whether you do this or not. If you do decide to add methods, then my personal recommendation would be to put these additional methods in your own class, not in the Data class. Your instructions tell you that the provided classes are complete (with the exception of the lock, unlock, and criteriaFind methods) so I dont think you should add methods to any of the existing classes.
    You do not have to use SQL in this assignment, and I dont think you should be trying to make the database act like an SQL database. I can see a lot of benifits for future growth, but I think it is way overkill for what we need to do.
    Regards, Andrew
  •  
    Nandini Sriram
    Ranch Hand
    Posts: 132
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thanks. That helped!!! I have also started with my GUI design . )) Do I need to provide for both one-way and two-way trips?
     
    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 Nandini
    No, two way trips are beyond the scope of the assignment. Don't give yourself more work than you have to.
    But you might want to think about what would be needed if a future requirement was to allow two (or 'x') way trips. And make sure that your server code does not exclude that possibility. It is nice if your client code could be easily updated to allow for this.
    Regards, Andrew
     
    Nandini Sriram
    Ranch Hand
    Posts: 132
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thanks Andrew, so only one-way trips!!!
    And suppose I want to use a combobox for the user to select the origin and destination, I have to open the db.db to get the cities listed in the database, right?
     
    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 Nandini

    And suppose I want to use a combobox for the user to select the origin and destination, I have to open the db.db to get the cities listed in the database, right?


    I think that would be the best way.
    Regards, Andrew
     
    Nandini Sriram
    Ranch Hand
    Posts: 132
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    On the database side, I can modify or subclass only the Data class and NOT the DataInfo or FieldInfo class, right?
    Also am I forbidden from using SQL altogether?
    Thanks
     
    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 Nandini
    If Data, DataInfo or FieldInfo contain deprecated methods, then you have to modify them to fix them.
    If Data, DataInfo or FieldInfo contain methods, variables, or constants that will not get documented correctly using JavaDoc then you will have to modify them to fix the JavaDoc comments.
    You could subclass DataInfo and FieldInfo if you wanted to - but I cannot see any point to it. Where would you use the subclassed versions? What would you want to change?
    You have to provide lock() unlock() and criteriaFind() methods, however it is your choice whether you do this through modification of the Data class or subclassing the Data class. Whichever you decide, you do have to document why you chose to do that.
    Apart from the items above, I believe you should not modify Data, DataInfo or FieldInfo.

    Also am I forbidden from using SQL altogether?


    No, it is not forbidden.
    However if you choose to implement SQL, then it will have to be in addition to providing remote access to all the public methods of the suncertify.db.Data class.
    Regards, Andrew
     
    Ranch Hand
    Posts: 58
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi Andrew,
    I don't understand one point you said.

    If Data, DataInfo or FieldInfo contain methods, variables, or constants that will not get documented correctly using JavaDoc then you will have to modify them to fix the JavaDoc comments.


    What does it mean? What kind of methods can not be documented correctly?
    Thanks.
     
    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 George,
    There is a requirement that "You must create a full suite of documentation for the classes of the completed project, including those that form part of this distribution.", so we have to ensure that the JavaDoc for the provided classes is correct.
    To give you some examples: Data.delete() has the wrong parameter listed, DatabaseException does not have any comments, DataInfo.getRecordNumber() uses an "@returns" tag instead of an "@return" tag. And there are many more.
    There are numerous programs that will check for these and other issues for you. The best one I have found for looking at JavaDoc is the "doccheck" doclet from Sun (you can get it from the JavaDoc page). The other applications I relied heavily upon were Checkstyle and Jlint & Antic.
    Regards
    Andrew
     
    reply
      Bookmark Topic Watch Topic
    • New Topic