title: synchronized(this) and observers notifications
body: <p>This is related, but definitely not identical, to this famous SO question:</p>
  
  <p><a href="https://stackoverflow.com/questions/442564">Avoid synchronized(this) in Java?</a></p>
  
  <p>Very often I've got an "observable subject" that likes to notify its observers when it is modified.  The notification is basically making "alien method" calls (as they're called in <em>Effective Java</em> etc.) I may have something like this:</p>
  
  <pre><code>public void updateData(params) {
      synchronized (this) {
          // do some computation here
      }
      notifyObservers(); // Never, EVER, call an alien method with a lock held (see Effective Java)
  }
  
  public synchronized Result getResult() {
     ...
  }
  </code></pre>
  
  <p>Should I be avoiding the <code>synchronized(this)</code> and hence also remove the <code>synchronized</code> from the <code>getResult()</code> method?</p>
  
  <p>Is this the following that people advising against <code>synchronized(this)</code> are recommending:</p>
  
  <pre><code>private final Object lock = new Object(); // shiny lock
  
  public void updateDate(params) {
      synchronized( lock ) {
         ...
      }
      notifyObservers();
  }
  
  public Result getResult() {
      synchronized( lock ) {
          return Result;
      }
  }
  </code></pre>
  
  <p>As a bonus question that doesn't warrant it's own SO question: if the latter is recommended, what do people who advise against using <em>synchronized(this)</em> think about the fact that methods in Java can be declared as "synchronized"?</p>