Last active
October 8, 2019 12:59
-
-
Save ebinjoy999/b667d4851a20638ca91e7840bfbd9b06 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Type1 | |
class A { | |
private final B b; | |
public A() { //Tightly coupled(Not good) | |
b = new B(a,b,c,d,e); //passing ingrediants | |
} | |
} | |
//Type2 | |
public class A { //Loosely coupled(Good) | |
private final B b; | |
public A(B b) { | |
this.b = b | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment