Coupling

From CSSEMediaWiki
Revision as of 21:36, 23 July 2009 by Paul Williams (Talk | contribs)
Jump to: navigation, search

Coupling

Coupling refers to the degree of direct knowledge that one class has of another. This is not meant to be interpreted as encapsulation vs. non-encapsulation. It is not a reference to one class's knowledge of another class's attributes or implementation, but rather knowledge of that other class itself.

Strong coupling occurs when a dependent class contains a pointer directly to a concrete class which provides the required behavior. Loose coupling occurs when the dependent class contains a pointer only to an interface, which can then be implemented by one or many concrete classes. Loose coupling provides extensibility to your design. You can easily add a new concrete class later that implements that same interface without ever having to modify and recompile the dependent class. Strong coupling does not allow this. User:Paul Williams

Other places for information on Coupling

Personal tools