title: What is the correct way of Message Passing between Classes in MVC?
body: <pre><code>public void Model {
      private SwingPropertyChangeSupport spcs;
      public void updatedb();
      public void addPropertyChangeListener(PropertyChangeListener listener)
  }
  public void Gui {
      private JFrame view;
      Gui() {
         view = new JFrame();  
         init();// for initilizing ui components
         EventQueue.invokeLater(new Runnable() {
              @Override
              public void run() {
                  try {
                      view.setVisible(true);
                  } catch (Exception e) {
                      e.printStackTrace();
                  }
              }
          });  
      }
      void addListener(ActionListener a);
      void init();
      void updateGUI();
  }
  
  public void Controller implements ActionListener,PropertyChangeListener {
       Model m;
       Gui g;
       public void PropertyChange(PropertyChangeEvent e);
       public void actionPerformed(ActionEvent e)
       Controller(Model m,Gui g){}
  
  }
  </code></pre>
  
  <ol>
  <li><p>What is the correct of way of passing messages between 3 classes <a href="https://drive.google.com/open?id=0BxzSDCbq81gINU1iNXpYTDgyQjA&amp;authuser=0" rel="nofollow noreferrer">MVC message passsing Image</a>   How to extend it for multiple controllers and views?I have read SO answers <a href="https://stackoverflow.com/questions/5217611/the-mvc-pattern-and-swing/16850977">The MVC pattern and SWING</a> saying this implementation is not efficient?</p></li>
  <li><p>And whether it is right to make Controller ActionListener and PropertyChangeListener?Will it make GUI sluggish when I call updatedb() inside actionperformed()?I also read about View having reference of Controller which maps gui actions to model actions. Is this way more efficient?</p></li>
  <li><p>Which part of code should be inside EventQueue.invokeLater? Is it right to  put init() function outside run()?Or Should I wrap the whole gui class inside run?</p></li>
  </ol>
  
  <hr>
  
  <pre><code>EventQueue.invokeLater(new Runnable() {
  
      public void run() {
          try {
              Gui view = new Gui();
          } catch (Exception e) {
              e.printStackTrace();
          }
      }
  });
  </code></pre>