title: Using DAO,DTO pattern as MVC
body: <pre><code>    public abstract class BaseDAO&lt;T extends BaseDTO&gt; {
  
          public Integer create(T dto) {
  
          }
          public Integer update(T dto) {
  
          }
          public Integer delete(T dto) {
  
         }
  
       }
  
  
      public class JobDAO extends BaseDAO&lt;JobDTO&gt; {
  
          public JobDAO(Connection conn) {
              super(conn);
          }
  
          @Override
          public String getDBTableName() {
              return "JobTABLE";
          }
      }
  
  
      public class BaseDTO {
  
          protected Integer ID;
  
          public Integer getID() {
              return ID;
          }
  
          public void setID(Integer ID) {
              this.ID = ID;
          }
      }
  
  
      public class JobDTO extends BaseDTO {
  
          Integer employerID;
          //getter
          //setter
  
       }
  
  
  
     public class Job_GUI extends javax.swing.JFrame {
      //GUI properties
      }
  </code></pre>
  
  <p>I am trying to understand<code>Model, View, Controller</code> Convention and I want to apply<code>MVC</code> to above class structures I have which consist of Data Transfer and Access Objects. What I'm failing to understand,  is my structure above MVC? if so, what is the model? I'm guessing the DTO are themselves <code>Model</code>. Job_GUI is a <code>View</code> which I know already, but what is the <code>Controller</code>?? </p>
  
  <p>I want to directly write the <code>actionPerformed</code> codes in the Job_GUI itself, something like this snippet to create a job in db: </p>
  
  <pre><code>JobDAO jdao = new JobDAO(conn);
             //create object jobDTO to hold all form values to be passed to JobDAO
             final JobDTO jobDTO = new JobDTO();
             //populating JobDTO with values from form
             jobDTO.setEmployerID(id);
             jobDTO.setDescription(description.getText());
             jobDTO.setTitle(txtTitle.getText());
             jdao.create(jobDTO);
  </code></pre>
  
  <p>but should the above be in the <code>Job_GUI</code> class itself or somewhere else. If I were to insert the above snippet in <code>Job_GUI</code> am I moving away from the MVC convention as such? Where would you put the above snippet? The confusion lies in identifying which is the <code>controller</code> class out of all that I have if I were to use the <code>DTO</code>,<code>DAO</code> <code>Design Pattern</code> for database interaction. </p>