*
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "HAS-A and tight coupling" Watch "HAS-A and tight coupling" New topic
Author

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,
[url]www.techlikes.com[/url]
*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.


Regards,

Anil Kumar Saha
SCJP 1.4
http://www.agilej.blogspot.com/
 
 
subject: HAS-A and tight coupling