• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Database fields and GUI fields

 
Mickey Mulligan
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Heya, I'd like to seperate the fields displayed in the GUI from those in the DB and have some kind of schema mapping the GUI's more descriptive field names to the names of the fields in the database.

Does anyone have any tips on how to implement this? I've thought about using a properties file, but these are just name=value pairs, right? Is there a better way to store the mapping? Eg:



Also, I suppose I'd like to store the size of each field.

I also intend to store the strings for the various GUI forms in a .properties file. Any thoughts on this approach? It seems like the right thing to do, unless there's a special swing method for doing this which I don't yet know about....
[ March 27, 2007: Message edited by: Mickey Mulligan ]
 
Mickey Mulligan
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, here's what I thought up:

a csv file embedded within the jar to describe the schema, and a crude CSVLoader class to load the details:



etc.

How does that sound? I think I could even dynamically generate the gui using this approach...
[ March 29, 2007: Message edited by: Mickey Mulligan ]
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mickey

This is a good idea to separate the database from GUI (or business). You can use for this a Value Object, you can find a lot of post with this theme here - just make a search.

Regards M
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic