Header Ads

ad

Bean Collaboration | Tight Coupling | Loose Coupling

See Button

Bean Collaboration | Tight Coupling | Loose Coupling

>> Keeping Spring bean classes in dependency or association is known as bean collaboration.

>> Ex :- Target class (Main class) ---------> Dependent class( Helper class)
             
                                      FlipKart  ------------> DTDC
                                      Vehicle  -------------> Engine

Different Approaches of Keeping Java classes in collaboration/ in dependency

1) Create Dependent class object in target class (Composition).
2) Make target extend from dependent class ( Inheritance ).
3) Make Underlying container ( IOC container ) injecting dependent class object to target class using setter or constructor injection.




































No comments