Skip to main content

Posts

Showing posts with the label coupling

Loose coupling

[Time: 4:32 mins] Loose (or low) coupling means (in a generic sense) that an entity can interact with another entity without being concerned with the internal implementation, and through a stable interface. Low coupling is implemented by using principles of information hiding. When two entities are loosely coupled, internal changes in one of them do not affect the other. The calling method is coupled to the called method and not it's implementation. Since we have already discussed encapsulation and information hiding in detail, I will not repeat it here. Loose coupling is achieved with information hiding And by programming to the interface rather than the implementation   Example  1 : Tightly coupled system  public  void  aMethod () {       ArrayList myList =  new  ArrayList () ;      doSomethingWithList ( list ) ;  }  ...