Context Logic In Production Code
Definition:
When the production code becomes aware of the context in which it is used.
Code Example:
public static void SaveToDatabase(Customer customerToWrite)
{
if (AreWeTesting)
WriteWithMockDatabase(customerToWrite);
else
Write(customerToWrite);
}
References:
Quality attributes
- Code Example
- Cause and Effect
- Frequency
- Refactoring