NO AI
NO PLAGIARISM
NO REFERENCES
NO CHAT GPT
Minimum 50 words per response:(What are your thoughts)
Cohesion and coupling are useful too. Cohesion is an interconnection between elements in the same module and coupling between the software modules (Thakur, 2024). Cohesion is an intra-module approach, whereas coupling is an inter-module approach (Thakur, 2024). Cohesion makes code reusable, easy to maintain, and easier to test. Coupling can make it tightly coupled to other modules and classes, which would make it less reusable without affecting other parts of the program.
Cohesion has several different types: functional, sequential, communicational, procedural, temporal, and logical cohesion (Thakur, 2024). Coupling has various types as well: content, common, control, stamp, data, and external coupling (Thakur, 2024). Regardless of which style you choose, it’s best to consider which type will best benefit your program and what you are hoping to achieve.
References:
TechTarget. (2019). Single Responsibility Principle (SRP). Retrieved from www.techtarget.com.
Thakur, S. (2024). Difference Between Cohesion And Coupling Explained. Retrieved from Unstop: unstop.com
Minimum 50 words per response:(What are your thoughts)
Cohesion describes the strength of the relationship between the purposes of the methods with the same class. A good software design principle promotes high cohesion which means that all the methods in the same class have similar purposes.
Coupling is the level of interaction between objects. Lower coupling provides better software design because objects can stand on its own with less interaction with other objects. This is because lower coupling software is easier to troubleshoot and change and thus allows for easier reusability.
This GitHub article (see Coupling and cohesion in OOP) is an excellent source discussing these two principles in the context of object oriented programming. I encourage you to take a quick look which might pique your interest.
References:
SRP, https://en.wikipedia.org/wiki/Single_responsibility_principle
Coupling and cohesion in OOP, https://ducmanhphan.github.io/2019-03-23-Coupling-and-Cohension-in-OOP/
Recent Commemts