In a CMP bean, should my instance fields be declared public or private?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Alex_Chaffee
Posted On:   Wednesday, December 12, 2001 09:24 AM

I understand that the answer has actually changed between EJB 1.1 and EJB 2.0.


Also, do I need to provide accessor/mutator methods (getX/setX) or does the container just reach in and set values for me?

Re: In a CMP bean, should my instance fields be declared public or private?

Posted By:   Anonymous  
Posted On:   Wednesday, December 12, 2001 11:44 PM

In ejb1.1 u should declare all the instance fields for cmp must be declared public and also all their accessor and mutataors methods must be defined.
In ejb2.0 we dont declare any instance variables in the class we just declare all cmp managed fields in the deployemnt descriptor as cmp fields and we define all the accesor and mutator methods for those cmp fields in the bean as abstract.
About | Sitemap | Contact