• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Are you using a ValueObjec? (URLyBird)

 
Alexandre Baldo
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Are you guys using a ValueObjec or are you working directly with
??

And before write to database are you making any validations?
Ex. Checking if a field is longer than it's maximum lenght? Or checking if the array has a valid lenght?

Thank's!
 
Jevgeni Zhukov
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did not use value objects, because String array is simple enough and you can keep the implementation dynamical (no need to hard code the db schema).
As to validation, I only checked every fields' length and complience to 8 bit US ASCII.
 
Jethro Borsje
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have chosen to use a ValueObject which decorates the String array and has an additional field for the record number. This way my application is flexible (fields can be added or removed without the need of adjusting the code), but I still have the advantage of having a ValueObject.
 
Alexandre Baldo
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank's for the replies!
I think I will use the String array.

See ya!
 
Iván Párraga
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

My assignment is not the same than you (B&S), saying that, I began to work with a value object but finally I refactored the solution to remove it and to work with String[]. I found that I didn't add any advantage and a lot of overhead was added due to transformations because all the methods in the provided interface were working with String[].

Cheers,

Iv�n
 
Jeffry Kristianto Yanuar
Ranch Hand
Posts: 759
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use the value object. Whatever your decision just document it.

Jeffry Kristianto Yanuar (Java Instructor)
SCJP 5.0, SCJA, SCJD (Working on UrlyBird 1.3.2) --> preparing to upload
 
Alexandre Baldo
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Iv�n P�rraga:
... I found that I didn't add any advantage and a lot of overhead was added due to transformations because all the methods in the provided interface were working with String[].


I agree with you! I'll keep it simple using the String[]. And, as Jeffry Kristianto said, I'll document my decision.

Thank you guys!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic