DRY programming dilemma

Posted by fayer on Stack Overflow See other posts from Stack Overflow or by fayer
Published on 2010-05-03T09:44:03Z Indexed on 2010/05/03 9:48 UTC
Read the original article Hit count: 446

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!

© Stack Overflow or respective owner

Related posts about design-patterns

Related posts about programming