Refactoring: parameterize constructor(weblogs.asp.net)

submitted by gpeipmangpeipman(3145) 2 years, 11 months ago

In legacy code you may find classes with constructor where some objects are created and initialized. These classes are not easily testable because they depend on other classes and therefore when you unit test these classes they may also throw exceptions of classes they depend on. In these cases we can use parameterize constructor refactoring.

1 comment |category: |Views: 310

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by dotnetchrisdotnetchris(157) 2 years, 11 months ago 0

Extremely simple blog post but it is a big win for it decoupling code, the step after this is instead of using the new operator to handle the creation of your classes now would be to leverage a DI framework.

Reply

information Login or create an account to comment on this story