title: In a java developed REST based app java architecture, should I split an implementation for requests/validations and one for domain?
body: <p>In the past lets say I have a domain model of <code>Bike</code>, so I'd make an interface called <code>Bike</code>, and in the past I'd create a implementation of that.  And in that implementation, I'd cram validation, JSON rules, database mapping annotations, etc.
  This seems to make the system ugly and brittle. So many gyrations to map and display and transform.</p>
  
  <p>I'm wondering (as I experiment) if I should create one implementation that just takes inputs and validates the data, and from it creates an instance of the model for use deeper inside the code after some transformations.
  So:</p>
  
  <pre><code>(Type)Bike -&gt; BikeWeb, BikeModel
  </code></pre>
  
  <p>However when I do that it seems that I lose the whole point of the json transformations, and add complexity with Interface hell. Because what I see happening is</p>
  
  <pre><code>(Type)Bike -&gt; (Types) BikeWeb, BikeModel -&gt; BikeWebImpl, BikeModelImpl
  </code></pre>
  
  <p>...times 1000</p>
  
  <p>I'm asking is the design pattern I'm describing one that is typical with some debate on which way to go, the actual pattern I should be using, or i'm out of my gourd.</p>
  
  <p>It seems every REST solution in the java world has this dilemma for me, so maybe should be using another solution, I'm open to that as well.</p>