• 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

GUI fields derived from DB Header?

 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I read a lot of posts, but could not get a clear answer. Maybe someone here could give me suggestions.
I have the B&S project. I have harcoded all the field lengths and field names like the customer Id, name and location in my GUI layer. I was rethinking on this if we need to get all the metadata from the DB layer and have it dynamically done in the GUI? Again, I would think doing field lengths this way seems reasonable , but not the field names.
How are you guys going about it? Thank you for the replies.
 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey Nina
I did the same things what you are thinking.
I fetch all fields name and length but dyamicly only field length is used.

But I read some threads here some guys did all dynamically but its really difficult to manage and maintain.
Do what you think easy.
 
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Nina,

I know people passed with 100% scores hardcoding it. My reasoning was, that if they want to extend this lousy database with extra fields anyways, I'd strongly recommend to redo it completely and replace it by relational database.
[ September 17, 2007: Message edited by: rinke hoekstra ]
 
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Nina,

I do as is showed in Andrew's book for the value object i have the name of the headers in a array. The record lenghts are verified in the data layer not in the gui layer with the information readed from the header.

I hope it help you.
 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nina,
The one thing I did that I don't see mentioned here is that I hard-coded it, but also checked that what I read in matches the field names and lengths for all six fields. If there is a mis-match I post a message to the Log and screen, and exit. I am just a little nervous about this, since if the test file the examiners use has a slight difference, I am dead. But I am going to trust that they know what they are doing.
 
Nina Binde
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for all the responses. I guess I will be doing more like Gabriel harcoding in the GUI, but making sure the data layer checks the field lengths.
Mark, yours would be similar , but you would go extra length in checking the field names too. What if the field name in the Database is not user friendly like "subcontractorname", it doesn't make sense to display as is to the user. That was my reasoning not to check for field names.
 
Mark Ebeling
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, I don't display what is given, only what I have hard-coded. But if it was different I would error out and exit.
 
She still doesn't approve of my superhero lifestyle. Or this shameless plug:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic