• Post Reply Bookmark Topic Watch Topic
  • New Topic

Do I need to implement Serializable inteface.  RSS feed

 
Vijay Kumar
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am calling a web service using AXIS. I have stubs code which has multiple DTO extends Serializable interface.

I have also same kind of DTOs layer which extract data from presentation layer and populate the DTOs generated by Axis and send across to web-service provider. Everything is working fine.

My question is that do I need to implement Serializable interface to my local DTOs or not. As per me neither I am going to send these object across to network nor storing anywhere, so I should not implements it. But still looking some comments.

Thanks
Vijay

 
Gaurav Raje
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Technically, if its working fine you are fine.
From a design perspective,
I know there are many theories floating around, about whether to implement or not. I usually use the approach -> if there is a specific reason why I shouldnt, I dont. Otherwise, I do.
Especially if some other class in the future uses this class (Which in your case may not happen).
But again, thats my opinion.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!