title: Service layer and controller: who takes care of what?
body: <p>In class we're now learning how to build up a Spring application, even though spring isn't directly involved, we learned how to make the interfaces for DAO and service layer objects. </p>
  
  <p>Please correct me if I'm wrong:
  DAO layer is pretty abstract: it just contains the CRUD operations and is further used to read data.(ie: get all objects, get specific objects, etc)</p>
  
  <p>Service layer: contains services to create things, and delete things, this is where business logic should be. </p>
  
  <p>Now all of this makes sense in the service layer; except "updating" objects. Do you just put a "update" function that just saves the object in your database? Or do you need to define the logic there as well? This is where my confusion is as, my understanding is objects in Spring are just POJO's. Now then who validates the data? </p>
  
  <p>Let's say I have an Object "child"
  it has:<code>Name</code>, <code>SurName</code>, <code>Gender</code>, <code>Photo</code>, <code>Birthdate</code>
  fields.
  how would I name the services? Or would you just let the controller take care of validation, which doesn't seem right to me. On the other hand it wouldn't seem right either to delegate every setter that needs to be called to the service layer.</p>
  
  <p>So just basically: help me with how to define saving your objects via the service layer.</p>