Helper class(es) vs functional inheritance. Best practice

Posted by Andrew Florko on Stack Overflow See other posts from Stack Overflow or by Andrew Florko
Published on 2010-06-17T19:29:24Z Indexed on 2010/06/17 19:33 UTC
Read the original article Hit count: 249

I have commands classes that implement ICommand { Execute } interface. Several commands have duplicate pieces of code. I have several options how to DRY:

  • Create static helper class(es) and move duplicate code there
  • Create commands inheritance with protected helper methods

What would you suggest and why?

Thank you in advance!

© Stack Overflow or respective owner

Related posts about best-practices

Related posts about language-agnostic