Coffeehouse Post

Single Post Permalink

View Thread: General Programmer Question : how much do you reuse code/classes?
  • User profile image
    Dr Herbie

    I've need reading around the 'Service Locator is an Anti-Pattern' meme trying to figure out why this should be an anti-pattern.  So the reason for it's anti-pattern status is simply that it makes classes harder to re-use compared to Composition Root (because of having a dependency on the service locator).

    This made me realise that I haven't re-used classes since I was an academic.  In my professional career, 95% of the code I write is business specific and only ever gets used within the company I work for (where we always use the same underlying framework, so the Service Locator is already there).

    I've work on long-standing LOB software projects, so it's not like I'm starting new projects very often.

    To what degree do you re-use classes and for context what sort of software do you normally write?