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

URLyBird - Question about DBAccess methods

 
Alexandre Baldo
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, guys!
I just got my assignment and I have a doubt about the DBAccess methods.
The methods takes/returns an array of String that represents a record.

Ex.


or


Each element of the array is a record value...

Is there a way to use an Object instead of the array of String to represent my record without breaking the interface?

Did you guys have the same problem?
I know we can do it the way it is, but it would be much easier if it was an object...

Thank you all!
 
Jethro Borsje
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should adhere to the interface as provided by Sun. However, you can use a Facade in front of the interface and let the Client communicate with this Facade. The Facade can wrap the String[] into a ValueObject.
 
Alexandre Baldo
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, Jethro!
 
Jeffry Kristianto Yanuar
Ranch Hand
Posts: 759
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can create the value Object and provide toArray() method to convert its value to array of String.

Jeffry Kristianto Yanuar
SCJP 5.0
SCJA
SCJD (Working on UrlyBird 1.3.2)
 
Alexandre Baldo
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's a good solution!
Thank you, Jeffry!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic