Cohesion and Coupling

Source: Internet
Author: User

Cohesion
Cohesion is a measurement of the correlation between components in a module. Ideally, you should clarify the responsibilities and division of labor of each component.
IfCodeThe scope of the association between them is too wide, and maintenance will be very difficult-because you need to modify the relevant Code while modifying some of the Code.
The preceding paramhandler class aggregates related processing processes. The class methods used to process XML can share data, and changes to one class method can be easily reflected in another method.
Coupling
When the code of each part of the system is closely bound together, it will produce tight coupling. This is a change in one component that forces other components to change accordingly. Tight coupling is not unique to procedural code, but procedural code is prone to coupling issues.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.