title: What is the use of single responsibility principle?
body: <p>I am trying to understand the Single Responsibility principle but I have tough time in grasping the concept. I am reading the book "Design Patterns and Best Practices in Java by Lucian-Paul Torje; Adrian Ianculescu; Kamalmeet Singh ." </p>
  
  <p>In this book I am reading Single responsibility principle chapter ,
  where they have a car class as shown below:</p>
  
  <p><a href="https://i.stack.imgur.com/pzND2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pzND2.png" alt="enter image description here"></a></p>
  
  <p>They said Car has both Car logic and database operations. In future if we want to change database then we need to change database logic and might need to change also car logic. And vice versa...</p>
  
  <p>The solution would be to create two classes as shown below:  </p>
  
  <p><a href="https://i.stack.imgur.com/51yKn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/51yKn.png" alt="enter image description here"></a></p>
  
  <p>My question is even if we create two classes , let’s consider  we are adding a new property called ‘price’ to the class CAR [Or changing the property ‘model’ to ‘carModel’ ] then don’t you think we also need to update CarDAO class like changing the SQL or so on.   </p>
  
  <p>So What is the use of SRP here?</p>