Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Type safe objects, or just String[]?

 
Colin Yates
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All,

Are you guys (+ girls ) just passing String[] back and forth or do you have a Type safe object, i.e. a value object call Record, or Row with a getName, getLocation etc.

My initial reaction was to have a type safe object, but I cannot really justify it.

What are you lot doing?

Thanks,

Col
 
Frans Janssen
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Colin,

In the interface I used String[] of course, because that was required.

In my Data layer I had a Record class that wrapped around the String data.
In my Business layer I had a Contractor class (my assignment was Bodgitt&Scarper), which indeed featured methods like getName, getLocation etc.

Frans.
 
Colin Yates
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And may I ask what was your "justification"? The examiners didn't mark you down for this?

It is my natural instinct to do this, but I cannot justify why
 
Frans Janssen
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also thought it is just good practice. I didn't even occur to me that I would have to justify this.

If you feel that you must, you can probably connect it with the 'must' that your code should be readable for junior programmers.

Frans.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic