• Post Reply Bookmark Topic Watch Topic
  • New Topic

Should an array be allowed to be a parameter in a session bean?  RSS feed

 
Pammi Anand
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a question. I have seen that all public methods in session beans have String or Integer or a DTO as a parameter. Can an array be supplied as a parameter to a session bean? Is it good design?

Thanks,
Pammi.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For remote business interfaces, the method parameters must be legal types for RMI/IIOP, which means any object that is serializable. So it will be ok for an array of serializable objects. For web service methods, they must be legal types for JAX-WS/JAX-RPC. Supported JAX-RPC types are defined here. I don't know about JAX-WS, but maybe you'll find something here.
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36446
454
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Pammi Anand:
Can an array be supplied as a parameter to a session bean? Is it good design?

Absolutely. An array or Collection of Serializable objects (or primitives) is perfectly valid.
 
Pammi Anand
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Christophe and Jeanne. Appreciate your help.

Thanks,
Pammi.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!