aspose file tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes The 2nd contructor of the Data class Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Developer Certification (SCJD/OCMJD)
Reply Bookmark "The 2nd contructor of the Data class " Watch "The 2nd contructor of the Data class " New topic
Author

The 2nd contructor of the Data class

ruilin yang
Ranch Hand

Joined: Feb 25, 2001
Posts: 334
I am in the middle of the way to finish my assighment.
You know the Data class provided by Sun has 2 constructors. I have not seen the need to use the 2nd one.
Does anybody have used it in the assignment ? Could you tell me when I need to use it or I do not need to use it.
Thanks
Ruilin
Aleksey Matiychenko
Ranch Hand

Joined: Apr 03, 2001
Posts: 178
I am not sure why everybody was ignoring this issue but think about what happens when user books a flight.
Ok we use a data class and modify the number of available seats in the db.db file. That's fine. But how do we show user what flight he/she booked. We can use a simple Table to display it but what if the user disconnects and comes back?
In this case the number of seats on the server reflects user's booking but the user does not have that information.
I think the second constructor was created so you can set up user information table and preserve reservation information there.
But that's just a thought. I might be wrong
ruilin yang
Ranch Hand

Joined: Feb 25, 2001
Posts: 334
Aleksey
You comments is great. I thought something in that way. If I use the 2nd constructor to save the reservation inf, I need to modify the schema to include the traveller's name and probably the booking data, etc.
Furthermore, the assignment does not ask to implement a login to collect userID. Without a userID, the system will not know who used the system and made a booking.
Please comments,
Ruilin
luis veron
Ranch Hand

Joined: Mar 07, 2001
Posts: 35
I think sun was expecting people to use the first constructor in conjunction with the conversion tool. But since lately when sun modified the instruction.html and the .jar file (assignment), they just provided us the db.db. No need to create a conversion tool
luis
Aleksey Matiychenko
Ranch Hand

Joined: Apr 03, 2001
Posts: 178
The assignment says that requirements are purposely incomplete.
I don't think a reservation system that cannot save and report my reservations is any good.
But that's just me
Matt DeLacey
Ranch Hand

Joined: Oct 12, 2000
Posts: 318
You can use modify to preserve your booking.
Aleksey Matiychenko
Ranch Hand

Joined: Apr 03, 2001
Posts: 178
What database file would you modify?
Matt DeLacey
Ranch Hand

Joined: Oct 12, 2000
Posts: 318
Not sure I understand your question.
You said, "I don't think a reservation system that cannot save and report my reservations is any good."
and I was just pointing out that you can modify the db.db file using the modify method. Everyone was talking about using the 2nd constructor and nobody had mentioned method modify.
With Respect,
Matt DeLacey
ruilin yang
Ranch Hand

Joined: Feb 25, 2001
Posts: 334
Matt,
The modify method saves a record to the database. However, in order to meaningfully record the booking information, the modify is mot enough. For example, traveler's name, travelling date, etc need to be saved. The Database schema need to be changed to save the book inf.
Comments please,
Ruilin
Matt DeLacey
Ranch Hand

Joined: Oct 12, 2000
Posts: 318
Whoa, Nellie!
We're in two different worlds. I see what you are saying, but that is WAY beyond the scope of this project. But I'm sure you know that. Have fun.
Matt
 
 
subject: The 2nd contructor of the Data class
 
Threads others viewed
Retrievals - Read Only Entity Bean Vs Customized Retrieval Method
Passed 138/155
Face managed bean in RAD7
Final Jar
Dynamic data class
IntelliJ Java IDE