This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes High and Low Coupling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "High and Low Coupling" Watch "High and Low Coupling" New topic
Author

High and Low Coupling

Arjun Reddy
Ranch Hand

Joined: Nov 10, 2007
Posts: 627
Hi all,

I was reading about this online.

A class that directly accesses member fields of another class, exhibits HIGH COUPLING.
When changing an implementation of a class, does not effect classes that use it, exhibits LOW COUPLING.


Can someone give me an example of a HighCoupling scenario and how Low coupling can be achieved in that case?

Thanks.
[ September 07, 2008: Message edited by: Arjun Reddy ]

Be Humble... Be Nice.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39053
    
  23
If you'd gone through beginners' (where I think this thread belongs ) you would have found this thread, which might answer your question.
Arjun Reddy
Ranch Hand

Joined: Nov 10, 2007
Posts: 627
Um... Campbell, can you give a code example of achieving loose coupling by using interfaces?

Thanks.
[ September 07, 2008: Message edited by: Arjun Reddy ]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39053
    
  23
Originally posted by Arjun Reddy:
Um... Campbell, can you give a code example of achieving loose coupling by using interfaces?

Thanks.
I can't think offhand how you would use interfaces to achieve loose coupling, sorry.
 
jQuery in Action, 2nd edition
 
subject: High and Low Coupling