title: Using TDD: File Synchronization with Client/Server
body: <p>I started trying to learn tdd and wanted to use it on a real project. So I decided on programming a simple file synchronization with a client and a server in java. 
  After more or less finishing the client part, I got stuck while writing the server part.</p>
  
  <p>In order to unit test the logic without accessing external resources, I put those in separate classes, so that I could mock them. So far, so good.</p>
  
  <p>Now here's my question: </p>
  
  <p><a href="http://i.stack.imgur.com/QAKpX.jpg" rel="nofollow">This image</a> shows how I imagined everything could look like, where green parts are finished and the yellow parts are not yet implemented.</p>
  
  <p>In my case I'd have to pass <code>RemoteServer</code> a <code>ConnectionManager</code>. The <code>ConnectionManager</code> would a need a <code>FileAdapter</code> and a <code>Communicator</code> in order to create a <code>ClientConnectionHandler</code>. That sounds like a little bit too much passing for me. Is this normal for tdd'ing or am I doing something wrong in order to keep everything testable?</p>
  
  <p>edit: The class ClientConnectionHandler is only responsible for the file sync logic on the server side, which means: Following my own mini protocol to receive files from a client.</p>