title: Resolving a call-chain anti-pattern
body: <p>I've begun to notice something of an anti-pattern in my ASP.NET development. It bothers me because it feels like the right thing to do to maintain good design, but at the same time it smells wrong.</p>
  
  <p>The problem is this: we have a multi-layered application, the bottom layer is a class handling calls to a service that provides us with data. Above that is a layer of classes that possible transform, manipulate, and check the data. Above that are the ASP.NET pages.</p>
  
  <p>In many cases, the methods from the the service layer don't need any changes before going on the view, so the model is just a straight pass through, like:</p>
  
  <pre><code>public List&lt;IData&gt; GetData(int id, string filter, bool check)
  {
      return DataService.GetData(id, filter, check);
  }
  </code></pre>
  
  <p>It's not wrong, nor necessarily awful to work on, but it creates an odd kind of copy/paste dependency. I'm also working on the underlying service, and it also replicates this patter a lot, and there are interfaces throughout. So what happens is, "I need to add <code>int someotherID</code> to <code>GetData</code>" So I add it to the model, the service caller, the service itself, and the interfaces. It doesn't help that <code>GetData</code> is actually representative of several methods that all use the same signature but return different information. The interfaces help a bit with that repetition, but it still crops up here and there.</p>
  
  <p>Is there a name for this anti-pattern? Is there a fix, or is a major change to the architecture the only real way? It sounds like I need to flatten my object model, but sometimes the data layer is doing transformations so it has value. I also like keeping my code separated between "calls an outside service" and "supplies page data."</p>