Dependency Injection – Keep your privates to yourself

Jacob Proffitt has hit the nail on the head with his “I do wish that people would admit that DI doesn’t have compelling applicability outside of Unit Testing” post, the discussion continues with Nate Kohari response post and Jacobs counter post. Oren has also joined in with two posts.

Here a some ideas for you to think about.

DI as a Silver Bullet – You lose power

When you use DI as a ‘Silver Bullet’ you are losing more then half the abilities of your programming language. You can not use static methods or the ‘new‘ keyword or sealed types. Oh, you have to make all your methods virtual too. This is going to be even harder once Extension Methods (and Linq) become main stream.

Code to Enable Change – Costs More

Creating Code that is there only to “Enable Change” has a big “YAGNI” written all over it. (Making the code more complex and thus wasting time in development and then in maintenance, for a chance that it will be used in the future). We have understood that this is the wrong plan ages ago. We now know that we can not predict the future and it is best to change our code only when we need to (a process called refactoring).

Keep your Privates to Yourself

Jacob, you are quite right about DI coming into fashion only because the tools where not good enough. DI does have other applications outside testing, but it is being overused in most application only to make the code testable.

One of the first issues that was discussed when TDD was starting was: “should we change our code to make it testable?”
Should we change the visibility of our code?
Should we change the design of our code?
This lead to a collision between testable code and OO encapsulation. Developers started to expose private parts of the code to enable testing. It started with private fields and methods and now it is the complete design. This collision still exists when using inadequate tools, but with the right tools, you can enjoy the best of both worlds.

Get the Best Tools to get the Job Done

Thousands of developers have understood this and have started testing there code without being forced to use a specific pattern required by some tools. Many development shops, didn’t test their code because of the testability/design collision. With the right tools they now understand and test their code.

As Joel Says: “Get the best tools

  1. For thhe appearance, clothes show shiny skins but feel mild and
    warm. You may also choose to work with a
    specialist, who for thyeir fee can promote your business effectively.
    Call today prior to my available dates are taken.

  2. Many small companies prefer to hire SEO specialists as consultants
    rather than full time employees, unless they have a certain amount of websites that need to be continuously maintained and
    optimized. Any business to conduct business on the web should have a web site created especially for creating an awareness of their products and ser-vices
    to the planet at large. Your baseline will tell you where
    your company began so you can measure positive or
    negative ROI (return on your investment). In this way,
    it is informed about the kind of Handy Information About Using The Expertise Of A Upholstery Cleaning Company common hvac (Jennifer) that a surfer is
    looking for.

  3. As said, most contaminated people don’t realize they may have herpes, if the
    signs and symptoms occur during the first outbreak,
    then they can be very severe.

  4. To top it all off, you will find the Everglades which aren’tthat far from the town. If you want a fantastic spa
    vacation that doesn’t cost a lot of, this might be a location worth checkihg
    out. Sometimes it stays mellow, however itt can also get quite rowdy as well
    by incorporating party goers going before early hours with
    the morning. Additionally, that iis not a crammed hotel.

  5. Alva is how he’s called and he feels comfortable when individuals utilize the name.
    Since she was 18 she’s been working as a production and distribution officer but she’s already requested a different one.
    South Dakota is when she and her husband live and her family loves it.
    The favorite hobby in my kids and use is doing martial arts
    and I’m going to be starting another thing along with it.
    You will find this site here:

  6. Thee gov’t would impose currency controls and Americans would not
    be able to hold, pay or accept foreign currency in america.
    If you are partial to natural beauties, you hawve to
    go for the beautiful beaches or islands full of
    coconuts. Silver is actually an excellent obtaining prospect you need to nnot pay for to miss.
    Action can be your only vehicle to get what your location is going.

  7. Each of them has a different function according to the intensity of
    the misspelled keywords. Improving Site Structure – This second part tells you How To Locate The Right Carpet Cleaner For Your Own Home conditioning slows – Katrina
    to properly structure URLs. While effective SEO needn’t be difficult,
    it does take work. This mode of advertisement was faster than the earlier ones and reached more people but it had
    its own limitations.

  8. Although Yahoo isn’t the biggest, or the highest ranking search engine
    on the internet, it is still one An Array
    Of Guidelines For Hiring A Carpet Cleaner current system (Rickey) the most essential, and if you want use search engine optimization and promotion as a main technique in your
    marketing arsenal, you unquestionably need to get listed here.
    The usual SEO methods include keyword research,
    link building and such. Your baseline will tell you where your company began so you can measure positive or negative ROI
    (return on your investment). A reputable SEO
    company won’t have any qualms about connecting potential clients with former ones.

  9. Gone are the days of one way marketing or merely just posting comments about your site or other
    related topics. Improving Site Structure – This second part
    tells you how to properly structure URLs. Auro – IN has Overcome Any Working With A Carpet Cleaner Obstacle With One Of These Tricks indianapolis heating and air (Billie)
    strong team that is built on the delivery of outstanding campaign results, customer service and appreciation, and high levels of technical capabilities and
    values. You have to take price quotes from different SEO companies locally and

  10. El especialista quiropráctico efectuará ajustes muy concretos de la articulación en cuestión, para
    calmar el dolor y solucionar el inconveniente, suprimiendo la presión sobre los nervios y músculos y devolviendo el movimiento
    y posición adecuada a la columna.

  11. Unquestionably imagine that which you stated.
    Your favourite reason seemed to be on the web the easiest factor to take into accout of.
    I say to you, I certainly get irked at the same time as folks think about concerns that they
    just don’t know about. You managed to hit the nail upon the highest as
    well as outlined out the entire thing with no need side
    effect , other people could take a signal. Will likely be again to get more.

  12. In both cases the battery cells still produced voltage after the test.
    For example, if you want to buy a jeep, you have to consider the
    jeep accessories that need be bought separately and include their cost
    in your budget. Fast-talking and pushy salespeople are good at this tactic so avoid it at all costs.

  13. Do you know crowdfunding WESYM? It’s a fantastic crowdfunding site in Japan. They hosts
    great projects in Japan. Many of the projects are written in Japanese,
    but some of them are for foreigners. Especially in case
    of idol projects, animation projects, I mean, Japanese
    cool cultural things. It’s like indiegogo, but their goal
    seems to backup and export Japanese culture.

  14. Cuenta con cuatro cabezales de masaje Shiatsu que
    realizan un movimiento ascendente y descendente durante la columna vertebral,
    ejercitando un masaje preciso y eficiente merced a su mecanismo basculante de 3 dimensiones.

  15. hello!,I really like your writing very so much! proportion we communicate extra
    about your article on AOL? I need an expert in this space to unravel
    my problem. Maybe that’s you! Taking a look forward to look you.

  16. Fantastc website you have here but I was wanting to
    know if youu knew off any user discussion forumss that cover the saame topics talked
    about in this article? I’d really like to be a part of online community where I can get suggestions
    from other knowledgeable individuals that share tthe same interest.
    If you have any recommendations, please let me know.

    Many thanks!

  17. Convenience, for some VOIP users, also means lesser costs
    on communication expenses. If there is a need for a base station and a
    cordless phone, the Panasonic Small Business VOIP Phone
    – KX-TGP550 SIP Base Station & 1 Cordless Handset is a great combination to have.
    After you cause been connected, you desire be proficient to talk to each other
    without any charges.

  18. Avoid documenting your ABSA internet banking pin number anywhere unsafe.
    I suspect that from the perspective of these news organizations, that 24,000 people a day die of hunger is not great news enough.
    Once you are out university of south africa suburban areas, it is quite difficult to find petrol pumps at frequent intervals so
    it is better to fill up before you start your journey.

  19. Turkey recipe can be seen on the table of every family
    on Thanksgiving Day as a traditional dish. There are other ingredients as well of
    course, like lime juice, green onions and tomato, but there’s no denying that this recipe is specifically
    for those who can’t get enough of cilantro. In a serving dish, spread a layer
    of refried beans.

  20. Very nice post. I simply stumbled upon your blog and wanted to say that
    I’ve truly loved browsing your weblog posts.

    After all I will be subscribing to your rss feed and I’m hoping you write
    once more soon!

  21. I do trust all the ideas you’ve introduced for your post.
    They’re very convincing and will certainly work.
    Still, the posts are too quick for beginners.
    Could you please lengthen them a little from next time?
    Thank you for the post.

  22. Your style is so unique compared to other people I have read stuff from.
    Thanks for posting when you have the opportunity, Guess I will just bookmark this page.

Add Comment

Required fields are marked *. Your email address will not be published.