Adaptive Code via C#: Agile coding with design patterns and SOLID principles (Ida Schander's Library) by Gary McLean Hall

Adaptive Code via C#: Agile coding with design patterns and SOLID principles (Ida Schander's Library) by Gary McLean Hall

Author:Gary McLean Hall
Language: eng
Format: mobi, epub, pdf
Publisher: Microsoft Press
Published: 2014-02-24T22:00:00+00:00


Listing 5-23 shows a common pattern that occurs whenever code contains extensive logging. The logging code becomes ubiquitous throughout the application, and the signal-to-noise ratio suffers.

LISTING 5-23 Logging code clouds the intent of methods.

Click here to view code image

* * *

public class ConcreteCalculator : ICalculator

{

public int Add(int x, int y)

{

Console.WriteLine("Add(x={0}, y={1})", x, y);

var addition = x + y;

Console.WriteLine("result={0}", addition);

return addition;

}

}



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.