title: Why do we sometimes separate behaviour from classes in Java
body: <p>Its a pretty basic question but I am new to Java designing to please excuse me. :)</p>
  
  <p>I want to know in which scenarios we need to separate the class behavior from the class itself. </p>
  
  <p>for e.g. </p>
  
  <p>If I have an class Employee, I will have some data in it like - name, age etc. Also this class will have some behavior like doWork() etc. Now in what scenario we can have data and the behavior inside once class (Employee) only and in which scenario we need to have 2 different classes for Employee data (EmployeeDTO) and behavior (EmployeeService) </p>
  
  <p>Very subjective question but am looking for some inputs on a design of a small application where I am taking data from a text file. Should I put the data and behavior in different classes or same? What will be your reason to justify this decision? </p>
  
  <p>PS: Any links to information on this will also be very useful :)</p>
  
  <p>Thankyou </p>