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,
posted 12 years ago
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.