Help coderanch get a
new server
by contributing to the fundraiser
  • 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

Converting Strings fields to base type when using a VO

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using a VO to exchange information from the server (business layer) and the client over network.

But, in the server, when I need to create a array list of the VOs, I am converting the database strings for each field in its base type to store in VO. And, when converting the rate string (currency) to a Float wrapper type, I need to care about localization, because in the database, the rates are stored as "$450.80" for example, and this are the US currency format.

My Vo has this variable:



But I don't know what to do at this point... Someone have a solution?

Other way I thought is just don't convert the database strings to its base types, and my VO could have strings as fields too. Maybe this be the way...

I would appreciate some comments.

Thanks,
Marcelo.
 
Marcelo Camargo
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, I took the folowing solution: I create the VO using strings as the fields, because this way I dont need to check for the field integrity.
My would be creating an aditional problem to me doing that.

So, now its more simple and easy to understand.

Marcelo.
 
look! it's a bird! it's a plane! It's .... a teeny tiny ad
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic