title: Practical Usage of N-Tier Architecture
body: <p>I'm a .NET web developer for a small organization. We have some skilled developers here, but what we don't have is anyone who's worked for larger, more organized, software shops.  We do all right, but I find myself wanting to structure my code better with little place to turn for advice.</p>
  
  <p>It comes to this. At some point someone in our organization decided we were going to use webservices whenever we had to do any data access at all no matter the case. Thus, our hardware architecture is organized so that is the only way we can access our databases.  This sounds fine in theory, but the problem is most of our apps turn out like this:</p>
  
  <p>Spaghetti Mess Of Code In The aspx.cs  ->  Web Service That Does Nothing But Call a Stored Procedure</p>
  
  <p>Beyond that there's not much separation.  Whenever I start trying to research better structural practices I wind up reading about things like dependency injections, dirty properties, and class factories, my head starts to swim, and I move on to something else in frustration.</p>
  
  <p>Here's a basic example of my wonderings. So let's say I have to make a page to select employees from a list, edit them, and update the database. Is it better to have the web service return an Employee object on a get, and accept an Employee object on an update? Or is it better to have the Employee object call the webservice to self populate?</p>
  
  <p>In other words: Employee emp = svc.GetEmployee(42);  vs  Employee emp = new Employee(42);</p>
  
  <p>The second example seems like it would be better organization for updates (update the relevant properties and call emp.Update()), but the problem is what if I need to get a list of Employees? It would be inconsistent to do Employee emp = new Employee(id); for a singular employee, but do svc.GetAllEmployees() for a list.</p>
  
  <p>I feel like I'm rambling a bit so I'm going to cease trying to explain and hope someone understands my confusion. I appreciate any advice that anyone can offer. Thanks!</p>