• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Value Objects in BMPs

 
seshu Palamanti
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a session bean which finds a BMP bean by its primary key using ejbFindbyPrimarykey() then to retrieve other values of the bean i use get methods to populate a Value object in session bean.How about setting and sending in the value object itself from with in the BMP bean.Does it work...? is it a good practice?.

Thanks in Advance.
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes it works and yes it�s a good practice. If you access the bean remotely through its remote interface is better to have coarse-grained methods that get/set bean�s attributes at once (passing or retrieving a VO). However if the bean is always accessed locally, then you might use fine-grained methods for getting/setting bean�s attributes one by one. As I understand from your design, the entity bean is hidden from the clients through a session fa�ade, which again is a good practice. Just make sure that the session ejb accesses the entity bean through its local interface.
Regards.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic