Before going through this post, I suggest you to go through my previous post on basic concepts in Dependency injection and Inversion of control. Demo on product. This demo is based on a traditional implementation approach: We have a Product class and it has a method which takes the discount and based on some business logic it applies the discount on the product. Product service will interact with database using ProductRepository. If you will notice ProductService has dependency on 2 concrete classes i.e. Discount and ProductRepository new Discount(); new ProductRepository(); We can hence say that ProductService is tightly coupled because of these 2 dependencies. We may require to use different discount based on several factors such as Product type, Some Festival or any other factor. Based on different discounts we may need to change ProductService class also in future you may change the database from SQL to Oracle, Again it may require ProductService changes which is viol...