File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is coupling

 
Anonymous
Ranch Hand
Posts: 18944
  • 0
  • send pies
  • Quote
  • Report post to moderator
In a recent job interview for position of junior developer this was one of the questions-
what do the terms "coupling" and "cohesion" mean?
I had no idea.
Can anybody help?

 
Rajesh Hegde
Ranch Hand
Posts: 112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Coupling and coehesion are term used in the design of software modules.
Coupling - is the degree of interaction b/w the different modules in the s/w. (inter- modular)
Cohesion- is the degree of interaction(binding) b/w parts of the same module.(intra-modular).

Good s/w design practice saus that the coupling should be minimum and cohesion must be maximum.
(ps- correct me is i am wrong in this regard).
Hope thats helps.
 
Ajith Kallambella
Sheriff
Posts: 5782
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am moving this to the Process forum.
Ajith
 
David Roberts
Ranch Hand
Posts: 142
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good stuff, I have a few questions for you
Rajesh to help me understand.
So is coupling as simple as an object holds a reference to another object?
I can see that there might be one way coupling and two way. Or is that de-coupled? For instance a Framework might know about, and execute methods on a object, but the object is decoupled, because it knows nothing of the framework.
Is that correct?
Is coupling usually a two way dependency, or do say one object is couple to another, while the other is decoupled?
I'm suprised to hear that they asked that question for a Junior Developer pos... I know guys who claim to be Senior Developers who don't know this stuff. I bet meena is more senior then some of the seniors I know...
------------------
David Roberts, SCJP2
[This message has been edited by David Roberts (edited March 31, 2001).]
 
martin fowler
Author
Ranch Hand
Posts: 53
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're interested in this topic, I'd take a look at the articles on OO design principles in http://www.objectmentor.com/publications/articlesBySubject.html
 
Jack Blassingame
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For a real good discussion of coupling and cohesion I would read a book called Code Complete. It talks about the various types of coupling (data, time, etc.) and why they are bad. Basically coupling has to do with the concepts that are the oppositie of encapsulation. Modules that have knowledge of each others data, Modules that must be executed in a certain sequence are a couple of examples of coupling.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic