• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Database fields and GUI fields

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic