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 766041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T16:58:54+00:00 2026-05-14T16:58:54+00:00

the situation is like this: im creating a Logger class that can write to

  • 0

the situation is like this:

im creating a Logger class that can write to a file but the write_to_file() function is in a helper class as a static function.

i could call that function but then the Log class would be dependent to the helper class.

isn’t dependency bad?

but if i can let it use a helper function then what is the point of having helper functions?

what should one prioritize here: using helper functions and have to include this helper class everywhere (but the other 99 methods wont be useful) or just copy and paste into the Log class (but then if i have done this 100 times and then make a change i have to change in 100 places).

share your thoughts and experience!

  • 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-14T16:58:54+00:00Added an answer on May 14, 2026 at 4:58 pm

    Dependencies aren’t bad per se; they just need to be effectively managed. It sounds like you might have a helper class that has more than one responsibility (100 methods seems like a lot to me), so maybe that helper class needs to be split apart into multiple classes.

    Another option is to create a IFileWriter interface which has the one helper method you need on it. Then, have the helper class implement that interface, and have the logger depend on the interface and not on the concrete helper class. That way, if you ever have the time to refactor the helper class the logger doesn’t have to change.

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

Sidebar

Related Questions

The situation is like this : Main project A. and a class library B.
I know a question like this was already asked, but the situation is a
I am creating a simple website . My situation is like this. After registering
The situation is like this: there is a continuous loop, that updates some values.
You can specify one buffer for your file stream like that: char buf[BUFFER_SIZE]; std::ofstream
The topic generically says it all. Basically in a situation like this: boost::scoped_array<int> p(new
The situation is somewhat like- var someVar = some_other_function(); someObj.addEventListener(click, function(){ some_function(someVar); }, false);
I have a problem that seems like its a result of a deadlock-situation. Whe
I'm in the process of creating a class that stores metadata about a particular
Suppose I'm creating a class to validate a number, like Social Security in US

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.