This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes HAS-A and tight coupling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "HAS-A and tight coupling" Watch "HAS-A and tight coupling" New topic

HAS-A and tight coupling

palla sridhar
Ranch Hand

Joined: Oct 15, 2007
Posts: 111
On page 164 of K & B, explanation for a Question is given as follows:

HAS-A relationships can lead to tight coupling, it is by no means always the case.

Can you explain how the relationship between HAS-A relationship and tight coupling.

Thanks and Regards,
*Nothing is CONSTANT in life, except CHANGE*
Anil Kumar Saha
Ranch Hand

Joined: Apr 07, 2004
Posts: 111
Tight coupling means difficult to refactor. Let us take a simple example of HAS-A relationship- A car HAS-A wheel. Now, suppose in future you want to refactor your code and want to move out the Wheel object out of the Car object, it will be bit difficult. That�s why HAS-A is tightly coupled.


Anil Kumar Saha
SCJP 1.4
I agree. Here's the link:
subject: HAS-A and tight coupling
Similar Threads
IS - A Relationship
Has-A relationship
Cohesion and Coupling