• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Arrays vs clearly defined types

 
Marius Snyman
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would it be considered an overkill to convert the arrays to field and record objects before passing it to the client. On the client side the objects are interrogated and updated and on the server side the objects are then converted to the arrays during/prior to the write operations.

My project specifies it must allow for enhancements with minimal impact in the client. Hard-coding fields may result in client changes, so I am contemplating using dynamically created/loaded fields and records with the validation in the classes. This way I expect that any future DB layout changes will automatically be accomodated.

Also, do you guys use String by default or do you validate the fields on both client and server for the datatypes. For example. The room can take 4 people. If I use fields and records I can simply build the validation into the class.

My question arises from the issue that I do middleware development for the most part and am so accustomed to working with serializable objects only that it feels akward to think of transmitting the arrays between client and server.

Any guidelines from you guys who already have acquired your SCJD?
 
Alex Belisle Turcot
Ranch Hand
Posts: 516
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

At the network layer, I transfer "Contractor" objects, not array of Strings.

For me, I use my Data DAO a little like I would use a "BufferedWriter" or any read/write Object in SUN's API. In the end I read/write Strings, but I handle the information through Objects from the domain model as much as possible.

I'm pretty sure I read others transferring array of strings, and I guess it's debatable and mostly "documentable"

Regards,
Alex
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic