• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB 2.0 and member visibility  RSS feed

 
Charley Watson
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To all:

I've seen this in example code, namely the Monson-Haefeld tome on EJB, but what is the prescribed visibility of instance members for Entities? That author uses public access for all member variables with his JBoss bound examples. Is this called for in the spec, or does it honor some other pattern that is tangential to EJB?

Thanks for any help,

CW
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Charley,

This applies for BMP only and I suppose is a matter of choice. I would personally use private instance variables. Check the Mastering EJBs by EdRoman and you�ll see that the AccountBean (see page 158) has private instance variables as well. I also don�t remember of any design pattern that takes the advantage of declaring public instance variables with entity ejbs. Maybe some other members can contradict me?
Regards.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!