Communicational Cohesion (High Cohesion)
Interactive Audio Lesson
Listen to a student-teacher conversation explaining the topic in a relatable way.
Introduction to Cohesion
π Unlock Audio Lesson
Sign up and enroll to listen to this audio lesson
Today, we are diving into the concept of cohesion. What do you think cohesion means in the context of software design?
I think it's about how closely related the tasks within a module are?
Exactly, cohesion refers to the degree to which elements within a module belong together. The higher the cohesion, the more focused the module is on a specific task. Remember the acronym 'MURD' for maintainability, understandability, reusability, and reduced complexity.
What types of cohesion are there?
Great question! There are several, including functional, sequential, communicational, procedural, temporal, logical, and coincidental cohesion, each with different implications for the design.
Communicational Cohesion
π Unlock Audio Lesson
Sign up and enroll to listen to this audio lesson
Now let's focus on communicational cohesion. Can anyone explain what that means?
Itβs when different functions in a module use the same data?
Exactly! Communicational cohesion occurs when the different operations of a module use the same input or output data. For example, if a module manages customer operations that involve functions like getting and updating customer details, all can share the same customer data.
So, it's good for making the code cleaner and easier to maintain?
Precisely! High cohesion reduces complexity and enhances reusability. Think of it as keeping your tasks organized around common goals or data.
Significance of High Cohesion
π Unlock Audio Lesson
Sign up and enroll to listen to this audio lesson
Why do you think high cohesion is essential for software design?
Because it makes modules easier to understand?
Absolutely! It also promotes reusability and makes modules simpler to test and maintain. Always aim for high cohesion in your designs.
What type of cohesion should we strive for?
Functional, sequential, and communicational cohesion are the best types to look for. This approach keeps your modules robust and manageable.
Practical Applications of Cohesion
π Unlock Audio Lesson
Sign up and enroll to listen to this audio lesson
Letβs discuss practical applications. Can someone give an example of a module that exhibits communicational cohesion?
How about a module that handles student records?
Perfect! If the module gets, updates, and deletes student records all referencing the same student data, it demonstrates communicational cohesion beautifully.
Does this mean we can link all functions that share the same data?
Exactly! Just ensure they work cohesively to avoid unnecessary complexity.
Introduction & Overview
Read summaries of the section's main ideas at different levels of detail.
Quick Overview
Standard
This section discusses communicational cohesion as one of the types of cohesion in software modules, emphasizing its importance in maintaining high cohesion, which contributes to a module's effectiveness and maintainability by ensuring all elements operate on the same input or output data.
Detailed
Detailed Summary
Communicational cohesion is a type of cohesion characterized by all elements of a module performing different functions that share common input data or produce the same output data. This section extensively covers the significance of communicational cohesion within the context of module design, explaining how modules that exhibit this type of cohesion can effectively centralize data operations, thus enhancing both maintainability and understanding of the system's architecture. The discussion highlights practical examples, such as a module that updates customer records, as an ideal representation of communicational cohesion, demonstrating the advantages of grouping related operations on shared data, which contributes to a higher cohesive design overall. The section reinforces the principles of high cohesion as favorable, given their role in reducing complexity and promoting reusability across software systems.
Audio Book
Dive deep into the subject with an immersive audiobook experience.
Definition of Communicational Cohesion
Chapter 1 of 3
π Unlock Audio Chapter
Sign up and enroll to access the full audio experience
Chapter Content
Communicational Cohesion (High Cohesion):
- Definition: All elements of the module operate on the same input data or produce the same output data. They perform different functions but use common data.
Detailed Explanation
Communicational cohesion refers to a scenario where different parts of a module work with the same data. Even though each part has a distinct role or function, they are logically connected because they manipulate or utilize shared data. This type of cohesion helps ensure that the different functionalities are organized around a central concept or data entity.
Examples & Analogies
Imagine a restaurant where the kitchen staff prepares different dishes using the same ingredients. For instance, if tomatoes are used, one chef might make a salad while another makes a salsa. Both dishes are distinct but rely on the shared ingredient β tomatoes. Similarly, in software, various functions may operate on the same set of data, like a CustomerOperations module that retrieves and updates customer data.
Characteristics of Communicational Cohesion
Chapter 2 of 3
π Unlock Audio Chapter
Sign up and enroll to access the full audio experience
Chapter Content
- Characteristics: The activities within the module are related by sharing common input or output data.
Detailed Explanation
The key characteristic of communicational cohesion is the relationship between activities within the module that rely on the same input or output data. This shared focus means that even if different processes are happening, they all contribute to a coherent goal related to that specific data. Modules with communicational cohesion help keep related processes together, which simplifies understanding and debugging.
Examples & Analogies
Think of a team of chefs in a kitchen preparing a meal. Each chef has a different task (like grilling, frying, or garnishing), but they are all working with the same set of ingredients (like chicken, vegetables, and spices). Their work is cohesive because they are all contributing to the same dish, similar to how functions within a module work with common data.
Example of Communicational Cohesion
Chapter 3 of 3
π Unlock Audio Chapter
Sign up and enroll to access the full audio experience
Chapter Content
- Example: A module CustomerOperations() that GetsCustomerDetails(), UpdatesCustomerAddress(), and DeletesCustomerRecord() β all acting on the customer data object. Or a module that CalculatesAverageTemperature() and DisplaysTemperatureGraph() using the same raw temperature sensor data.
Detailed Explanation
In the given example of a CustomerOperations module, multiple functions (like getting details, updating an address, or deleting a record) are all interacting with the same customer data object. This showcases communicational cohesion as all these functions revolve around shared customer data, emphasizing the importance and utility of that data in multiple contexts.
Examples & Analogies
Think of an online banking system where a user can view their account balance, make transfers, and update their personal information. All these actions (viewing, transferring, updating) are related because they manipulate the same bank account data, similar to a team of mechanics working on a car, each doing different tasks but all focusing on the same vehicle's performance.
Key Concepts
-
Cohesion: Refers to the degree to which the elements of a module belong together.
-
Communicational Cohesion: A form of high cohesion where different functions operate on shared data.
-
High Cohesion: Desirable as it enhances module maintainability and understandability.
Examples & Applications
A module named 'CustomerOperations()' that contains functions to 'GetCustomerDetails()', 'UpdateCustomerAddress()', and 'DeleteCustomerRecord()', all sharing the 'customer data'.
A module that calculates average temperature and displays a temperature graph, both of which use the same temperature data.
Memory Aids
Interactive tools to help you remember key concepts
Rhymes
When your module's functions unite, sharing data feels just right, communicational cohesion's the key, to design that's harmonious and free.
Stories
Imagine a librarian who manages books. Each functionβchecking out, returning, and updatingβis linked by a common library database, illustrating communicational cohesion.
Memory Tools
Remember the term 'HERC', which stands for High Energy Resulting Cohesion. The higher the energy, the better the relatedness of functions!
Acronyms
Use 'C.H.A.R.M.' -> Communicational High Action Relation Module for a module that tightly interlinks its functions with shared data.
Flash Cards
Glossary
- Cohesion
A qualitative measure of how strongly related and focused the responsibilities of a single module are.
- Communicational Cohesion
A type of cohesion where all elements of the module operate on the same input data or produce the same output data.
- High Cohesion
A desirable design principle where a module performs a well-defined task or closely related set of responsibilities.
- Module
A self-contained unit of code that performs a specific function within a software system.
Reference links
Supplementary resources to enhance your learning experience.