Difference between revisions of "OO Best Practice"

From Suhrid.net Wiki
Jump to navigationJump to search
(Created page with "== Intro == * * * * Category:OCPJP")
 
Line 1: Line 1:
 
== Intro ==
 
== Intro ==
  
*
+
* Exam focuses on recognizing tight encapsulation, loose coupling and high cohesion.
*
+
 
*
+
== Coupling ==
*
+
 
 +
* Coupling is the degree to which one class knows about the other class.
 +
* Ideally a class should know about another class only through what has been exposed through its interface/API.
 +
* If two classes know internal details about each other - they are said to be tightly coupled. This would mean that they cannot be modified independently.
  
  
  
 
[[Category:OCPJP]]
 
[[Category:OCPJP]]

Revision as of 21:17, 21 August 2011

Intro

  • Exam focuses on recognizing tight encapsulation, loose coupling and high cohesion.

Coupling

  • Coupling is the degree to which one class knows about the other class.
  • Ideally a class should know about another class only through what has been exposed through its interface/API.
  • If two classes know internal details about each other - they are said to be tightly coupled. This would mean that they cannot be modified independently.