Skip to content

Instantly share code, notes, and snippets.

@ThiagoBarradas
Last active June 8, 2023 21:51
Show Gist options
  • Save ThiagoBarradas/5ff1c67e8c83d819f174c7de8c183d78 to your computer and use it in GitHub Desktop.
Save ThiagoBarradas/5ff1c67e8c83d819f174c7de8c183d78 to your computer and use it in GitHub Desktop.
SOLID [D] - Wrong implementation with high coupling
public class CreditCard
{
public bool Pay(int amount)
{
// do something
}
}
public class Person
{
public CreditCard CreditCard { get; set; }
public Person()
{
this.CreditCard = new CreditCard();
}
}
// calling
Person person = new Person();
person.CreditCard.Pay(100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment