Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

High and Low Coupling

 
Arjun Reddy
Ranch Hand
Posts: 629
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 629
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic