This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

High and Low Coupling  RSS feed

 
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
Marshal
Posts: 55677
161
  • 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
Marshal
Posts: 55677
161
  • 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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!