title: Creating Model classes in a MVC based applications
body: <p>I am learning Spring MVC. And in most of the examples and tutorials i have seen that a simple Model class is created by defining private variables and providing setters and getters methods for them</p>
  
  <p>for example like the one below</p>
  
  <pre><code>public static class Person  {
  
      private String firstName;
      private String lastName";
  
       public String firstName() {
          return firstName;
      }
  
      public void firstName(String bar1) {
          this.firstName = firstName;
      }
  
      public String lastName() {
          return lastName;
      }
  
      public void lastName(String bar2) {
          this.lastName = lastName;
      }
  
  }
  </code></pre>
  
  <p>But i can define the above class by just defining public variables as i am not doing any processing in the getters and setters method, like below</p>
  
  <pre><code>public static class Person  {
      public String firstName;
      public String lastName";
  }
  </code></pre>
  
  <p>and access it like </p>
  
  <pre><code>Person objPerson = new Person();
  objPerson.firstName = 'Mickey';
  objPerson.lastName = 'Mouse';
  </code></pre>
  
  <p>I understand the approach is not very dynamic in the sense if at later point i decide to put some processing logic in getter and setter methods, then i may have to change all my client objects to change to use the getters and setters. but is that all or there is other implications if i take this route?</p>