Concrete class must not be dependent on each other This is called low couplings. It is good. High coupling is bad Using system; Namespace coupling { Class program { Static void main(string[] args) { Console.writelinw("hello world"); } } Public class UserInterface { Public void GetData() { Console.write("enter your username"); Var userName = console.readLine(); Console.write("enter your password"); Var password = console.readLine(); IBusines business= new Business(); business.SignUp(userName, password); } } Public class Business : IBusines { Public void SignUp(string userName, string password) { // validation Var dataAccess = new DataAccess(); DataAccess.Store(userName, password); } } Public class BusinessV2 : IBusiness { Public void SignUp(string userName, string password) { // validation Var dataAccess = new DataAccess(); DataAccess.Store(userName, password); } } Public class DataAccess : IDataAccess { Public void
- Get link
- Other Apps