title: Android data-binding (similar to WPF)?
body: <p>I have searched for some similar questions before posting - however I have a general question when it comes to Android and data binding (and the other answers I check did not really get me much further...). Assume you have a class Vehicle:</p>
  
  <pre><code>public class Vehicle {
  
  private Owner owner;
  private String brand;
  
  //getter and setter for above attributes...
  
  }
  </code></pre>
  
  <p>and here is the Owner class ....</p>
  
  <pre><code>public class Owner {
  
  private String name;
  
  }
  </code></pre>
  
  <p>Now - I was just recently looking into MVVM (ModelView-ViewModel) pattern as employed by Microsofts WPF. Which got me wondering: Assuming I would want to bind the name property of my owner object which is a child of the Vehicle object - would there be some standard way in Android to achieve this? Also presuming, that I might have to validate input before I can have the Model updated?</p>
  
  <p>I was imagining the following components (assuming MVVM):</p>
  
  <ul>
  <li>The View (an Activity) contains no application logic - so its more or less empty</li>
  <li>A ViewModel would handle the instance of the Vehicle object and perform actions on it</li>
  <li>The Model itself would look as the code I posted before - totally oblivious to the View 
  and the ViewModel</li>
  </ul>
  
  <p>Now when I add my EditTexts, TextViews and so on to the view, I want them to bind to certain the properties of my context object (Vehicle in this case) ... Mhhh if my question is not clear or you need further informatio do let me know :) thanks in advance.</p>
  
  <p>P.s. I think people familiar with WPF might now what I mean? I myself just read about WPF and found it's a nice way to handle stuff.</p>
  
  <p>P.P.s I am aware of the <a href="http://code.google.com/p/android-binding/" rel="noreferrer">android binding</a> project but I was wondering if there is a sort of build-in approach in Android or maybe some convention someone is following :) this really is more of a binding-theory question I guess ...</p>