Menu
  • HOME
  • TAGS

loose coupling related to composition

oop,composition,loose-coupling,tightly-coupled-code

What you have there is not really tight coupling. Tight coupling would be this: class CustomerRepository { private readonly Database database; public CustomerRepository() { this.database = new Database; } } The class has a hardcoded dependency on a specific Database class which cannot be substituted. That's really tight coupling. The...