• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Table Column Names

 
Lora Louise
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did anyone do anything with the table column names. I think titles like "Origin airport" could be shortened to "Origin", but I'm not sure if it's a good idea to just chop off the second word. What if the titles in the future aren't in english and it doesn't make sense in that context.
That brings up another issue, making the application internationalized. I've used a ResourceBundle to extract strings for messages, button labels, etc. But, I've got some hard-coded strings when interrogating database field names.
For instance, to find out which field is "Available seats" I do a string comparison. Should I instead start modifying the Data class to specify the field number that will always provide "Available seats"?
public static final int SEATS_INDEX = 8;
Then, in my business check for
if (index = Data.SEATS_INDEX)
//modify the value at this index when booking seats
 
Lora Louise
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That should be "==" of course
Thinking about it, actually I don't think a SEATS_INDEX is a good variable for the generic Data class. I think it would be better put where the business logic is.
 
vladimir levin
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a good question. There really is a spectrum of
choices here, ranging from hard coding everything to
getting information dynamically. I believe any solution you
choose will be ok as long as it is documented. Try to pick
a solution that is not complex (i.e. not too dynamic) but which
does provide reasonably good maintainability.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic