Hi,

My question is about access level modifiers in the model design (with EJB3 
entity and Seam). For example, I'd like to have something like that :


  | @Entity
  | public class MyUser
  |     extends XXX
  | {
  |     private String login;
  | 
  |     protected MyUser()
  |     {
  |          // used by EJB3
  |     }
  | 
  |     public MyUser(String login)
  |     {
  |         this.setLogin(login);
  |     }
  | 
  |     public String getLogin()
  |     {
  |         return this.login;
  |     }
  | 
  |     protected void setLogin(String login)
  |     {
  |         this.login = login;
  |     }
  | }
  | 

So that "login" cannot be modified (~final). EJB3 specs allow the protected 
constructor (i don't know about the setter), but anyway, Seam requires a public 
no-args constructor and a public setLogin. For me that's not a good design 
practice since the entity is then merely a C struct.

What are your opinion about that ? Am i doing something wrong ?
Thanks

David

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035954#4035954

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035954
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to