This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes UB bookRoom/createRow/deleteRow methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "UB bookRoom/createRow/deleteRow methods" Watch "UB bookRoom/createRow/deleteRow methods" New topic
Author

UB bookRoom/createRow/deleteRow methods

K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2229
    
    7

Hi all, I have a concern about where I should really put the bookRoom, createRow, deleteRow methods. I have read many people put these methods in their Data class but I currently have these methods in my table model class. Is that ok??

Since my table model interacts with the Data class eg for bookRoom method:
1. lock(recNum)
2. update(strAry)
3. unlock(recNum)
4. do stuff to refresh the table view by calling fireXXXX

Or should I ensure these methods must be called by implementing an interface eg
public MyHotelTable extends AbstractTableModel implement XXInterface

where XXInterface defines the bookRoom, createRow etc methods.


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: UB bookRoom/createRow/deleteRow methods
 
Similar Threads
Help with getting the correct recnum for book seats method
Does this guarantee a unique client?
Database connection type return problem
JTable adding a RowFilter can no longer add to the table get invalid range?
Seperating GUI from implementation