title: Why creating protected properties in beans is counted a bad practice?
body: <p>What I mean is: </p>
  
  <pre><code>public class SomeBackingBean {
  
     protected String someString;
  
     public void setSomeString (String str) { 
        this.someString = str; 
     }
  
     public String getSomeString {
        return someString;
     }
  }
  </code></pre>
  
  <p>It was just a general case for a general answer.</p>
  
  <p>Now second example:</p>
  
  <pre><code>public abstract class AbstractBean&lt;T extends EntityInterface&gt; {
  
     protected T entity;
  
     public void setEntity (T t) {
        this.entity = t;
     }
  
     public void getEntity () {
        return entity;
     }
  
     protected ReturnType calculateSomethingCommon () {
        //use entity (knowing that it implements EntityInterface) 
        //to implement some common for all subclasses logic
     }
  }
  
  public class ConcreteBean extends AbstractBean&lt;ConcreteEntity&gt; {
     ...
     //and here we can write only specific for this bean methods
     ...
  }
  </code></pre>
  
  <p>Is second example an example of bad practice too?</p>