In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Background:
Today, when I was reading the preface to "Code cleanliness" by Robert C.Martin (Uncle BOb), I accidentally saw "high cohesion, low coupling". After a tumult, I found that I was not very clear about what I had learned in my freshman year.
Content:
After consulting the information on the Internet, I finally understand its meaning:
High cohesion means that within a function or module, the closer the relationship between the components (methods or classes), the better, that is, all the components are directed towards the same goal.
Low coupling refers to the connection between the impassable functional modules, the less dependent the better, independent of each other.
In the words of Mr. Zhang, who was object-oriented at that time, it is: who does what he does.
Quoting netizens' explanation, I think it's right:
High cohesion and low coupling is a concept in software engineering and a standard to judge whether the design is good or not. It is mainly object-oriented design, which mainly depends on whether the cohesion of the class is high and whether the degree of coupling is low. Cohesion is the degree to which the elements in a module are combined with each other, and high cohesion is the high degree to which the elements in a module are combined with each other. The so-called high cohesion means that a software module is composed of highly related code and is responsible for only one task, which is often called the principle of single responsibility.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
Set attribute and filter the desired fields
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.