Skip to content

Instantly share code, notes, and snippets.

@trikitrok
Created March 13, 2025 19:49
Show Gist options
  • Save trikitrok/dca9be4649a5275237ba6266422a13b3 to your computer and use it in GitHub Desktop.
Save trikitrok/dca9be4649a5275237ba6266422a13b3 to your computer and use it in GitHub Desktop.
public interface Customer
{
double GetEarnedDiscount();
void AddToOrdersHistory(Order order);
}
// Null Customer's implementation
public class NotFoundCustomer : Customer
{
private readonly double DEFAULT_DISCOUNT = 1.0;
public double GetEarnedDiscount()
{
return DEFAULT_DISCOUNT;
}
// Refused bequest???
public void AddToOrdersHistory(Order order)
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment