File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 REST with Spring (video course) this week in the Spring 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
It's not a secret anymore!