about server

stanley wang

Greenhorn

Posts: 12

posted 14 years ago

Hi,ranchers: i don't know how can i do about the server side. RMI and Multithread! how can i do?

Mike Piotrowski

Ranch Hand

Posts: 82

posted 14 years ago

Stanley, Could you be a little more specific with your question? Sounds like your not sure on how to implemnt the network server. Your two choices are either RMI or sending serialized objects over a TCP socket connections. Try doing some searches through old posts here, you will find some very valuable information on the subject. Mike

Gosling Gong

Ranch Hand

Posts: 51

posted 14 years ago

continue the posthttp://www.coderanch.com/t/136452/sr/certification/passed I still have some questions about your GUI design, 1) you said you handle the events with inner classes inside the SearchPanel and BookPanel, does that mean you didn't use MainFrame to mediating between SearchPanel and BookPanel? 2) in your Booking flight dialog, did you talk DataFacade directly to book flight, or ask MainFrame to do it? 3) after user clicking the OK on the booking dialog, did you exist the dialog or still make it there untill the booking process is finished? how do handle the GUI frozen when booking and searching, did you use another thread to do it?

Mike Piotrowski

Ranch Hand

Posts: 82

posted 14 years ago

Gosling, Sorry I didn't get back to you, forgot to check that thread. In my main frame for my GUI (FBNMain.java) I would obtain a reference to either a local or remote database object that implements DataInterface. This is determind by the command line args specified by the user. I then create a DataFacade object that gets passed my database object. When the SearchPanel and BookPanel get created they get passed a reference to the DataFacade object and a reference to the JTable from the DisplayPanel. When a user clicks a button to search or book a flight the events are handled by inner classes which implement ActionListener. The actionPerformed method will handle all the form validation then call the appropriate method of the DataFacade class. Then will update the view in the table.

how do handle the GUI frozen when booking and searching, did you use another thread to do it?

I didn't do anything. I never in all my testing waited more than a millisecond for a response. Though that is only testing my client and server on the same machine. I did talk about that in my design choices document and explained it could be an area for future concern or enhancements. Mike

Robin Underwood

Ranch Hand

Posts: 117

posted 14 years ago

Mike, it sounds like you explained alot of issues in your design document. About how many pages was your document? Do you have much detail about what you did, or only just why you did it? Thanks so much!

Mike Piotrowski

Ranch Hand

Posts: 82

posted 14 years ago

Robin, My design document was about 2 1/2 pages broken down into 7 main topics. RMI vs serialized objects, server design, modify vs extending data, exception handling, GUI design, record locking and cammand line arguments. I gave a quick overview of how I handled each, some pros and cons and possible future enhancements. Mike