Writing code, especially in larger software projects can be very challenging. In this video, I'm going to cover cohesion and coupling to help you write better code. I'll go through a Python program in detail and I'll show you how to write code that has low coupling and strong cohesion. Coupling and Cohesion are part of the GRASP principles of object-oriented design, as proposed by Craig Larman in his book (see below for a link).
Here are a few books about software design that might interest you:
- Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and Iterative Development, by Craig Larman: amzn.to/364wgLb
- Design Patterns: Elements of Reusable Object-Oriented Software, by the Gang of Four: amzn.to/39451Cv
💡Here's my FREE 7-step guide to help you consistently design great software: arjancodes.com/designguide.
🎓 Courses:
The Software Designer Mindset: www.arjancodes.com/mindset
The Software Designer Mindset Team Packages: www.arjancodes.com/sas
The Software Architect Mindset: Pre-register now! www.arjancodes.com/architect
Next Level Python: Become a Python Expert: www.arjancodes.com/next-level-python
The 30-Day Design Challenge: www.arjancodes.com/30ddc
🛒 GEAR & RECOMMENDED BOOKS: kit.co/arjancodes.
You can find the code I worked on in this episode in my GitHub repository: github.com/arjancodes/betterpython
All parts in this series:
Part 1: Cohesion and coupling - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-eiDyK_ofPPM.html
Part 2: Dependency inversion - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-Kv5jhbSkqLE.html
Part 3: The strategy pattern - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-WQ8bNdxREHU.html
Part 4: The observer pattern - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-oNalXg67XEE.html
Part 5: Unit testing and code coverage - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-jmP3fp_BhmE.html
Part 6: Template method and bridge - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-t0mCrXHsLbI.html
Part 7: Exception handling - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-ZsvftkbbrR0.html
Part 7b: Monadic error handling - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-J-HWmoTKhC8.html
Part 8: Software architecture - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-ihtIcGkTFBU.html
Part 9: SOLID principles - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-pTB30aXS77U.html
Part 10: Object creation patterns - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-Rm4JP7JfsKY.html
Chapters:
0:00 Introduction
0:47 What is cohesion?
1:37 What is coupling?
3:59 Code example intro
6:39 Analyzing the code
7:56 Information expert
11:19 Reducing coupling
16:32 Improving cohesion
22:40 Recap
25:37 Outro
If you enjoyed this content, give this video a like. If you want to watch more of my upcoming videos, consider subscribing to my channel!
DISCLAIMER - The links in this description might be affiliate links. If you purchase a product or service through one of those links, I may receive a small commission. There is no additional charge to you. Thanks for supporting my channel so I can continue to provide you with free content each week!
22 янв 2021