• Post Reply Bookmark Topic Watch Topic
  • New Topic

Converting Strings fields to base type when using a VO  RSS feed

 
Marcelo Camargo
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!