本网站的中文版本尚处早期开发阶段。如果您发现其中存在错字、纰漏或其他任何问题,请随时联系向我反馈。

Inappropriate Intimacy

Signs and Symptoms

One class uses the internal fields and methods of another class.

Reasons for the Problem

Keep a close eye on classes that spend too much time together. Good classes should know as little about each other as possible. Such classes are easier to maintain and reuse.

Treatment

Payoff

  • Improves code organization.

  • Simplifies support and code reuse.