Join Jungwoo Ryoo for an in-depth discussion in this video Consistency, part of Python: Design Patterns.
- Other than simply using Design Patterns,…there are also universal principles you need…to be applying whenever you're coding.…Consistency is one of the hallmarks…of good software engineering.…One of the reasons why we recommend the use…of Design Patterns is to promote the consistency…of the code.…If the same solution is used over and over again…to solve the same problem,…users need to modify only one piece of code…when there is a need for changing the code.…
Otherwise, you need to develop different strategies…for different solutions throughout the code…to accommodate for the same change requirement.…The benefit of promoting consistency include…reducing the risk of making mistakes,…since the same piece of code is used over and over again.…Another benefit is increasing the possibility…of detecting errors, since more sets of eyes look…at the same code and may spot the errors more quickly.…
Saving the cost of software development is another benefit,…since you simply reuse the well-established design solutions…in the form of patterns…
- Understanding design patterns
- Best design practices: consistency, completeness, and correctness
- Working with creational patterns
- Working with structural patterns
- Working with behavioral patterns
Skill Level Intermediate
Q: In the strategy pattern example, why does the code keep executing the default function rather than the alternate?
A: The programming demonstration skips the step of defining what the strategy pattern should be when an alternate function name is provided
as an argument as shown below.
1. Understanding Design Patterns
2. Creational Patterns
3. Structural Patterns
4. Behavioral Patterns
5. Design Best Practices
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.