Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6477573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:57:53+00:00 2026-05-25T06:57:53+00:00

I started trying to learn tdd and wanted to use it on a real

  • 0

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.

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.

Now here’s my question:

This image shows how I imagined everything could look like, where green parts are finished and the yellow parts are not yet implemented.

In my case I’d have to pass RemoteServer a ConnectionManager. The ConnectionManager would a need a FileAdapter and a Communicator in order to create a ClientConnectionHandler. 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?

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T06:57:54+00:00Added an answer on May 25, 2026 at 6:57 am

    It’s pretty normal. If you get one class that has many dependencies, it likely has too many responsibilities as well. But having one class that depends on another class that depends on another – that’s normal.

    This is why IoC Container libraries like Spring are popular. They make it easier to wire up (configure and resolve) all of the dependencies.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to learn how to do some very simple client-server application programming. Basically,
I just started programming with objects recently and am trying to learn good habits
I am trying to learn the basics of C, C++ programming, so I've started
I'm trying to learn how to make a simple call to the server from
I'm trying to learn how to use textures in OpenGL. I started reading the
I'm having real problems getting PDO_MYSQL working. I started by just trying to install
I have just started trying to make a simple game with XNA 3.1 to
Still trying to learn the basic of jquery so in the weekend I started
I'm trying to learn Spring+Hibernate and I started using Lazy loading with Hibernate. To
I am trying to learn mySQL database, and have started taking a look at

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.