SE 23: Coupling & Cohesion with Examples | Software Engineering
Summary
TLDRThe transcript discusses software design concepts, focusing on the importance of cohesion and coupling in engineering. It explores various models like the teacher, student, and hood models, emphasizing their interdependencies and functions. The session delves into the significance of modularity, highlighting how it impacts software design and development. The speaker also touches on external coupling, control coupling, and the role of communication in software models. The discussion aims to provide insights into effective software design strategies that enhance maintainability, scalability, and reliability.
Takeaways
- 😀 The session focuses on the importance of software design, concepts, and engineering subject playlists.
- 🎓 It explores the next important topics, including session types, good and bad software, design coupling, and cohesion.
- 🔍 The discussion covers important questions that have been asked in previous sessions, emphasizing the need for understanding the relationship between software models.
- 🔗 It delves into the different types of models like teacher model, student model, hood model, and office model, and how they share information.
- 📊 The session explains the concept of dependency and the number of relationships between software models, using diagrams to illustrate total and four models.
- 🛠️ It introduces the idea of 'no dependency, no' in the second diagram, which is about model relationships and information sharing methods.
- 🔄 The concept of cardinality is discussed, which is about the degree of dependency and the number of relationships between software models.
- 💬 Communication between models is highlighted, emphasizing the need for models to work on input and output data, and the importance of updating records in databases.
- 🔢 The session also touches on the importance of logical cohesion, where elements of the model perform similar types of operations, such as error handling, sorting, searching, etc.
- 🔧 The benefits of high cohesion and low coupling in software design are discussed, including improved reliability, maintainability, and the ability to make changes with minimal impact on other models.
Q & A
What is coupling in the context of software design?
-Coupling refers to the degree of interdependence or the number of relationships between different software modules. High coupling means modules are highly dependent on each other, while low coupling means they are independent.
What are the different types of coupling?
-The types of coupling include no coupling, loose coupling, and strong coupling. No coupling means modules do not share any information, loose coupling means modules share minimal information, and strong coupling means modules heavily depend on each other.
What is cohesion in software design?
-Cohesion refers to how closely related the responsibilities of a module are. High cohesion means that the module's elements are highly related and perform similar tasks, while low cohesion indicates that the module performs unrelated tasks.
Why is low coupling and high cohesion preferred in software design?
-Low coupling and high cohesion are preferred because they improve readability, maintainability, and reusability of the software. Modules with low coupling and high cohesion are easier to understand, test, and modify without affecting other parts of the system.
Can you provide an example of global coupling?
-An example of global coupling is when multiple modules in a program share and depend on a global variable. For instance, in a school management system, a global variable like 'teacherCount' might be shared across different modules.
What is external coupling?
-External coupling occurs when two or more modules in a project depend on external tools, devices, or libraries. For example, if a module imports an external library for file handling or communication protocols, it is considered external coupling.
What is logical cohesion?
-Logical cohesion occurs when elements within a module perform similar types of operations but may not be related in terms of functionality. For example, error handling, sorting, and searching operations grouped in one module demonstrate logical cohesion.
What is procedural cohesion?
-Procedural cohesion refers to the elements of a module being related by the order in which tasks are performed. For instance, if a module contains functions that must be executed in a specific sequence, like reading data, processing it, and then saving it, this is procedural cohesion.
What is the difference between coincidental cohesion and functional cohesion?
-Coincidental cohesion occurs when the elements within a module have no meaningful relationship, whereas functional cohesion happens when all the elements of a module contribute to a single, well-defined task or functionality. Functional cohesion is highly desirable in software design.
Why is high cohesion important in software design?
-High cohesion is important because it ensures that the module's elements are related and work towards the same goal. This makes the system easier to maintain, understand, and test, and promotes code reuse.
Outlines
😀 Software Design Concepts
The first paragraph introduces the topic of software design, focusing on the importance of understanding various models and their relationships within the context of a project. It discusses the need for good software design practices and the benefits of high cohesion and low coupling in software models. The paragraph also touches on the types of models, such as teacher model, student model, hood model, and office model, and how they share information with each other. It emphasizes the significance of defining the degree of dependency and the number of relationships between software models. The discussion also includes the importance of diagrams for visualizing the total model and the functions within it, as well as the methods used to handle dependencies and data flow between models.
😀 Cohesion and Coupling in Software Design
The second paragraph delves deeper into the concepts of cohesion and coupling in software design. It explains how cohesion refers to the degree to which the elements within a module belong together, while coupling refers to the degree of interdependence between modules. The paragraph highlights the importance of designing software with high cohesion and low coupling to achieve a robust and maintainable system. It also discusses different types of cohesion, such as coincidental, logical, and functional cohesion, and their impact on software design. The paragraph further explores the concept of logical cohesion and how it allows for similar types of operations to be performed on the elements of a model. Examples are given to illustrate how different elements can perform similar operations, and the importance of understanding these relationships for effective software design is emphasized.
😀 Understanding High Cohesion and Low Coupling
The third paragraph emphasizes the importance of high cohesion and low coupling in software design. It discusses how high cohesion within a module allows for better understanding and maintenance, while low coupling between modules enables easier changes with minimal impact on other parts of the system. The paragraph also explains the benefits of these design principles, such as improved reliability, maintainability, and testability of the software. It further elaborates on how to achieve high cohesion and low coupling by understanding the relationships between data and how to design models that can be easily tested and modified. The paragraph concludes by stressing the importance of these concepts in creating a well-designed software system that is both efficient and effective.
Mindmap
Keywords
💡Software Design
💡Cohesion
💡Coupling
💡Model
💡Global Variables
💡External Coupling
💡Control Coupling
💡Data Coupling
💡Class of Model
💡Consistency
💡Logical Cohesion
Highlights
Introduction to the session on software design, concepts, and engineering subject playlists link.
Discussion on the next important topics, including session starting, types, and good and bad software.
Exploration of important questions that have been asked in previous sessions.
Explanation of the concept of coupling and cohesion in software design.
Different models like teacher model, student model, hood model, and office model are introduced.
Sharing of information with each other through these models is discussed.
Definition of coupling in terms of degree of interdependence and number of relationships between software modules.
Discussion on the four types of models and their sharing of information functions.
Explanation of how to handle no dependency and no in-degree in the second diagram.
Introduction to the concept of cordless coupling and its benefits.
Discussion on how to reward loop coupling like in the diagram.
Explanation of the global variables and their impact on the model.
Introduction to external coupling and its types in a project.
Explanation of control coupling and its general handling of functional, flag, and boolean-related information.
Discussion on data coupling and its importance in passing information between modules.
Introduction to class of model execution information and its methods.
Explanation of how to generate good design by understanding high cohesion.
Discussion on the importance of logical cohesion and how elements of the model perform similar types of operations.
Introduction to procedural cohesion and its role in executing functions within the program.
Explanation of communication cohesion and how it works with input and output data.
Discussion on sequence cohesion and how it deals with the output of one element to the next input element.
Introduction to functional cohesion and its role in performing similar types of functionalities through different elements.
Discussion on the importance of understanding the relationship between data and how it leads to good design.
Explanation of how high cohesion and low coupling can lead to better software design.
Discussion on the benefits of high cohesion, such as maintainability and the ability to make changes with minimal impact.
Introduction to the concept of model development with an emphasis on accurate design.
Explanation of how high cohesion allows for easy removal of models with the least amount of coupling.
Discussion on the importance of testing ability and how high cohesion and low coupling make it easier to test models.
Conclusion on the importance of cohesion and coupling in software design and how they contribute to good design practices.
Transcripts
हेलो एवरीवन दिस इस वृषाली इन प्रीवियस
सेशन स्वीट्स सॉफ्टवेयर डिजाइन
कॉन्सेप्ट्स की एग्जांपल
इंजीनियरिंग सब्जेक्ट प्लेलिस्ट लिंक इन
बिलो डिस्क्रिप्शन
वे विल डिस्कस डी नेक्स्ट इंपॉर्टेंट
टॉपिक डेट इस कपलिंग और कोहीसियन लेट
स्टार्ट डी सेशन
विद डी टाइप्स और गुड और बाद सॉफ्टवेयर
डिजाइन कपलिंग और कोहीसियन आते दी और वे
डिस्कस सम इंपॉर्टेंट क्वेश्चंस डेट हैव
एस्क्ड इन प्रीवियस एयर क्वेश्चन पेपर लेट
सी जो डीज प्वाइंट्स वन बाय वन
व्हाट एक्जेक्टली कपलिंग इन पर्टिकुलर
प्रोजेक्ट तेरे अरे लेट्स ऑफ मॉडल पर
एग्जांपल कॉलेज मैनेजमेंट सिस्टम
एप्लीकेशन सो तेरे अरे डिफरेंट मॉडल लाइक
टीचर मॉडल स्टूडेंट मॉडल हुड मॉडल और ऑफिस
मॉडल सो हो जो दिस मॉडल्स शेर इनफॉरमेशन
विथ एच अदर दिस इस कॉल्ड स कपिल स पर डी
डेफिनेशन डी कपलिंग इस डिग्री ऑफ
इंट्राडिपेंडेंट और नंबर ऑफ रिलेशंस
बिटवीन सॉफ्टवेयर मॉडल
डायग्राम हर डर आर टोटल फोर मॉडल और दिस
फोर मॉडल कांत शेर इनफॉरमेशन फंक्शंस
मैथर्ड विथ एच अदर सो दिस इस कॉल्ड देवर
इसे नो डिपेंडेंसी नो इन डी सेकंड
डायग्राम अगेन देवर आर फोर मॉडल और देवर
सम व्हाट इनफॉरमेशन और मैथर्ड विथ एच अदर
सो दिस इस कॉर्डलेसली कपल और सम
डिपेंडेंसी आर देवर नो इन दिस थर्ड
डायग्राम सी हर जो मॉडल आर टोटली डिपेंड
ऑन एच अदर दिस इस कॉल्ड
यू हैव तू रिक्वायर्ड लो कपलिंग लाइक दिस
डायग्राम
एग्जांपल्स
इन दिस डायग्राम हर मॉडल वन मॉडल तू मॉडल
थ्री सो जो दिस मोडल शेर से टाइप ऑफ
फंक्शंस और मैथर्ड वेन्यू मेक एन चेंज इन
वन मोडल विच इस इफेक्ट ऑन अनदर मॉडल दिस
इस कॉल्ड स कंटेंट कपल दे शेर फंक्शंस और
मैथर्ड विथ एच अदर नेक्स्ट वन इसे एन आम
कपल सी विले जेनरेटिंग एन पर्टिकुलर
प्रोग्राम यू हैव तू डिक्लेअर ग्लोबल
वैरियेबल्स राइट पर एग्जांपल ग्लोबल इन
टीचर ए इक्वल तू 10 सो एट डी टाइम जो डी
मॉडल सर से ग्लोबल वेरिएबल और ग्लोबल डाटा
आइटम दिस इस कॉल्ड स आम कपलिंग नेक्स्ट
नो डी नेक्स्ट टाइप इस एक्सटर्नल कपलिंग
व्हेन यू तू और मोर मॉडल इन वन प्रोजेक्ट
एक्सेस से टाइप ऑफ एक्सटर्नल टूल्स और
डिवाइस इस पर एग्जांपल दे उसे से टाइप ऑफ
एक्सटर्नल लाइब्रेरी फाइल इंपोर्ट फाइल
डिफरेंट कम्युनिकेशन प्रोटोकॉल और डिवाइस
इंटरफेस सो दिस इस कॉल्ड स एक्सटर्नल कपल
डी नेक्स्ट वाइस एन कंट्रोल कपल सो
कंट्रोल कंप्लेन जनरली हैंडल फंक्शनल
फ्लोर बिटवीन सॉफ्टवेयर मॉडल जनरली जो डी
फ्लैग और बुलियन रिलेटेड इनफॉरमेशन शेर
इन दिस डायग्राम हर मॉडल तू सपोज दिस
फ्लैग सेट इक्वल तू वन दें
नेक्स्ट मॉडल वन ऑपरेशंस
फ्लैग इक्वल तू जीरो दे कांत एक्सेस मोडल
वन ऑपरेशंस राइट
डिफरेंट डाटा स्ट्रक्चर ऑब्जेक्ट्स और
एल्गोरिथम सो दिस इस कॉल्ड स स्टांप
कपलिंग डी नेक्स्ट वन इसे एन डाटा कपलिंग
सीरियल आई थिंक यू जो आर फैमिली विद यू
आर्गुमेंट लिस्ट पैरामीटर दिस किड ऑफ
फंक्शनैलिटी इन पर्टिकुलर प्रोग्राम यू
डिक्लेअर एन पर्टिकुलर फंक्शन और पास
पैरामीटर पर एग्जांपल वाइड एडिशन और यू
पास इंतजार ए इंतजार बी आगे एन पैरामीटर
राइट सो वॅटीवर डी पैरामीटर पास इन मोडल
वन मॉडल तू उसे दो पैरामीटर इनफॉरमेशन दिस
इस कॉल्ड स डाटा कपल
नो डी नेक्स्ट टॉपिक
राइट सो ए क्लास ऑफ मोडल एक्सिस इनफॉरमेशन
मैथर्ड ऑफ क्लास सी ऑफ मॉडल बी सो दिस इस
कॉल्ड कपिल मोडल एक्सिस इनफॉरमेशन ऑफ मॉडल
बी डेट इस इंट्रा डिपेंडेंट राइट और ऑन डी
अपोजिट ऑफ कोहीसियन कोहीसियन मेंस डी
एक्सिस इनफॉरमेशन इंटर रिलेटेड यार इन
मॉडल ए और बी सो दे एक्सरसाइज इनफॉरमेशन
मैथर्ड विथ एच अदर डेट इस इंटर रिलेटेड सो
दिस इस कॉल्ड
एलिमेंट्स ऑफ मोडल बिलॉन्ग टुगेदर और इंटर
रिलेटेड राइट सो पर जेनरेटिंग एन गुड
डिजाइन यू हैव तू रिक्वायर्ड हाय कोहीसियन
लेट डिस्कस नेक्स्ट नो
डी प्रोवाइड डी बेस्ट रिजल्ट और कंसीडेंटल
कोचस वन लेट डिस्कस जो डी टाइप्स विथ
एग्जांपल
नो डी फर्स्ट टाइप ऑफ कोहीसियन इस
कोइंसिडेंटल कोहीसियन सो बेसिकली लेट टेक
एन एग्जांपल ऑफ कैलकुलेटर सो इन कैलकुलेटर
देवर आर मल्टीपल टास्क लाइक एडिशन
सब्सट्रैक्शन मल्टीप्लिकेशन और डिवीजन बट
दिस अल टास्क आर नोट रिलेटेड विच इथर राइट
और दे वेरी लूजली रिलेटेड विथ इ अदर सो
दिस इस कॉल्ड स कोइंसिडेंटल कोहीसियन डी
नेक्स्ट वन इसे एन लॉजिकल कोहेचन सो
लॉजिकल कोहीसियन मिंस जो डी एलिमेंट्स ऑफ
डी मॉडल परफॉर्म सिमिलर टाइप्स ऑफ ऑपरेशंस
इन दिस मॉडल देवर आर टोटल थ्री क्लास सो
दिस थ्री ग्लास परफॉर्म सिमिलर ऑपरेशंस
लाइक एरर हैंडलिंग सोर्टिंग सर्चिंग और सम
व्हाट आईएफ एल्स कंडीशन
फ्रॉम दी प्रोग्राम
नो डी नेक्स्ट टाइप इस प्रोसीजर कोहीसियन
सो प्रोसीजर कोहीसियन मेंस इन योर
प्रोग्राम योर एग्जीक्यूट जो डी फंक्शन
मैथर्ड सिचुएशन
पर एग्जांपल कलिंग वन फंक्शन तू अनदर
फंक्शन पर एग्जांपल यू डिक्लेअर वाइड
एडिशन और यू कल वाइड डिस्प्ले फंक्शन
फ्रॉम दिस फंक्शन नेक्स्ट लूप स्टेटमेंट
रीडिंग रिकॉर्ड सो जो डी सिचुएशन
परफॉर्मेंस और सीक्वेंशियल स्टेप ऑफ
एक्शंस आर कॉल्ड आज प्रोसीजर कोहीसियन डी
नेक्स्ट वन इसे एन कम्युनिकेशन सो बेसिकली
कम्युनिकेशंस कोहीसियन मिंस हर जो डी
एलिमेंट्स ऑफ मॉडल वर्किंग ऑन से इनपुट और
आउटपुट डाटा लेट सी हेयर इन दिस एग्जांपल
सपोज यू हैव तू अपडेट रिकॉर्ड इन डेटाबेस
और आफ्टर अपडेट यू हैव तू सेंड तू डाटा तू
डी प्रिंटर पर प्रिंटिंग परपज सो हर इनपुट
और आउटपुट वर्क ऑन डी से टाइम दिस इस
कॉल्ड स कम्युनिकेशन सो बेसिकली आईटी वर्क
ऑन सिचुएशन स्टेप्स ऑफ एक्शन
बिटवीन जो डी एलिमेंट्स जो डी एक्शन
नो डी नेक्स्ट वन इसे एन सीक्वेंस
कोहीसियन सो बेसिकली सीक्वेंस कोहीसियन
मिंस आउटपुट ऑफ वन एलिमेंट ट्वीट आज एन
इनपुट तू डी अदर एलिमेंट सी हेयर सपोज यू
हैव तू परफॉर्म एडिशन प्रोग्राम सो फर्स्ट
यू हैव तू इंटर डी नंबर्स डेट इसे तू दिस
इस डी इनपुट राइट नो दे पास आगे ए आउटपुट
तू डी परफॉर्म एडिशन ऑफ डेट नंबर्स आज एन
इनपुट सो 2 + 2 = 4 और आफ्टर डेट डिस्प्ले
एडिशन सो एडिशन बिल बी डिस्प्लेस सो दिस
इस एन सीक्वेंस दिस इस कॉल्ड स सीक्वेंस
कोहीसियन और लास्ट वन इसे एन फंक्शन सो
फंक्शन मेंस इन पर्टिकुलर सिंगल मोडल जो
ऑपरेशंस आर परफॉर्म सिमिलर टाइप्स ऑफ
फंक्शनैलिटीज थ्रू डिफरेंट एलिमेंट्स लेट
टेक एग्जांपल ऑफ रेलवे रिजर्वेशन सिस्टम
राइट सो जो दिस एक्शंस परफॉर्म पर सिमिलर
टाइप्स ऑफ गोल्ड डी फाइनल गोल इसे तू
रिजर्व एन सेट इन रेलवे राइट सो जो दिस
डिफरेंट एलिमेंट्स परफॉर्म सिमिलर टाइप्स
ऑफ फंक्शनैलिटी देवर गोल्ड और से दिस इस
कॉल्ड स फंक्शन स्ट्रांग
नव सी हेयर इन दिस डायग्राम इन सॉफ्टवेयर
इंजीनियरिंग सपोर्ट
और देवर इस एन वेरी लो कोहीसियन सीरियल वन
तू थ्री इन दिस इंटर क्लासेस देवर इस नो
रिलेशन बिटवीन डेट और ली रिलेशन बिटवीन
दिस राइट सो दिस लो कोहीसियन और हाय
कपलिंग जेनरेट एन बेड डिजाइन राइट ऑन डी
अपोजिट ऑफ डेट सी हेयर इन दिस डायग्राम
देवर इसे एन मॉडल ए बी और सी सो देवर इस
एन सम व्हाट कपलिंग इसे डर डेट इसे लो
कपलिंग इस देवर आईटी इस वेरी इसी तू
अंडरस्टैंड राइट और हाली कोहीसियन मिंस जो
डी इंटरनल क्लास आर इंटर रिलेटेड विद एच
अदर सो दिस इस एन गुड वन दे प्रोवाइड एन
गुड सॉफ्टवेयर डिजाइन विच इसे तू
अंडरस्टैंड सो स पर योर एग्जाम पॉइंट ऑफ
व्यू दिस इस वन ऑफ डी मोस्ट इंपॉर्टेंट
क्वेश्चन
वही हाय कोहीसियन और लो कपलिंग इसे
रिक्वायर्ड
सो थे आंसर का था क्वेश्चन इस दिस सीरियल
इन दिस डायग्राम दिस इस ए मॉडल वन मॉडल तू
और मॉडल थ्री इन दिस मॉडल वन डर आर थ्री
क्लासेस तू हेविंग तू क्लासेस और मॉडल
थ्री हेविंग थ्री क्लासेस सो मॉडल वन
एक्सेस इनफॉरमेशन ऑफ मॉडल थ्री और मोडल वन
अलसो एक्सेस इनफॉरमेशन ऑफ मॉडल तू दिस इस
कॉल्ड स कप प्ले सो देवर इस एन ली कपलिंग
विच इसे तू अंडरस्टैंड राइट सो दिउ तू लुक
व्हाट आर डी बेनिफिट्स फर्स्ट रीडेबिलिटी
सो दिस मॉडल सर इजी तू अंडरस्टैंड विच
मॉडल आर कनेक्ट विद विच वन विच इस नोट एन
परिसर मोड राइट नेक्स्ट वन मेंटेन एबिलिटी
सपोज यू कैन मेक एन चेंज इन वन मॉडल विच
इस लिटिल इंपैक्ट ऑन अदर मॉडल राइट डी
नेक्स्ट वन
मॉडल डेवलपमेंट एक्यूरेट डिजाइन
आईएफ यू वांट तू रिमूव दिस मॉडल थ्री सो
यू कैन इजीली रिमूव ठोस
कोल्डेस्ट कोहीसियन और देवर इस एन हाय
कोहीसियन इन दिस पर्टिकुलर सिस्टम राइट सो
डी एडवांटेज ऑफ हाय कोहीसियन इस रेडी मिस
जो दिस रिलेटेड फंक्शन मिस पार्ट वन क्लास
एक्सिस फंक्शन मैथर्ड ऑफ पार्ट 2 पार्ट 3
सो डेट इस वेरी इसी तू अंडरस्टैंड दे इसे
डी इंटर रिलेशनशिप बिटवीन डेट रूसे
एबिलिटी इजीली यू कैन रूसे दिस मोडल इन डी
अंदर सिस्टम डेन रिलायबिलिटी बेसिकली दिउ
तू लो कपलिंग और हाय कोहीसियन जनरल ओवरऑल
इंप्रूवमेंट ऑफ सिस्टम विच इस वेरी इसी तू
अंडरस्टैंड देवर इस एन इंटर रिलेशन बिटवीन
डेट विच इस नोट एन परिसर वन और टेस्ट
एबिलिटी सो मॉडल आर वेरी इजी तू टेस्ट और
दीपक यू कैन इजीली टेस्ट जो ठोस क्लास और
देवर फंक्शंस और मैथर्ड थॉट्स वही हाय
कोहेसिव और लो कपलिंग जेनरेट्स एन गुड
डिजाइन
सो स पर योर प्रीवियस एयर क्वेश्चन पेपर
थिस तू क्वेश्चंस आर मोस्ट इंपॉर्टेंट दे
बिल आस्क अन्य वन क्वेश्चन फ्रॉम दिस
व्हाट डू यू मीन बाय टर्म कोहीसियन और
कपलिंग इन डी कॉन्टेक्स्ट ऑफ सॉफ्टवेयर
डिजाइन हो अदर कॉन्सेप्ट्स आर यूजफुल पर
गुड डिजाइंस सिस्टम यू आर यू हैव तू
एक्सप्लेन देवर डेफिनेशन डी टाइप्स विथ
एग्जांपल पर सेवन मार्क्स और लास्ट वन इस
एन वॉइस ऑफ डिजाइन शुड हैव हाय कोहेसिव और
लो कपलिंग जस्टिफाई हर यू हैव तू
एक्सप्लेन जो डी इनफॉरमेशन ऑन प्रीवियस
लाइट्स पर 8th मार्क्स
दिस इस जो अबाउट कपलिंग और कोहीसियन थैंक
यू
Voir Plus de Vidéos Connexes
TOPCIT Software | 07. Software Detail Design
SE 1 : Introduction to Software Engineering | Nature of Software | SE Full Course
Continued Learning: The Beauty of Maintenance - Kent Beck - DDD Europe 2020
what is software designing? full Explanation | Learn Coding
What is Domain Model and Conceptual Classes?. Tutorial
1-3 What is Software Engineering
5.0 / 5 (0 votes)