Join Jungwoo Ryoo for an in-depth discussion in this video Facade example, part of Python: Advanced Design Patterns.
- [Instructor] Implementing Facade is quite straightforward.…Let's first review subsystem classes.…Subsystem A, shown here, has two methods,…which are simply printing messages…to show which method is being called.…See the print statement?…Subsystem B does the same in this example.…Now let's define our Facade class.…
We need a constructor which simply instantiates…the two subsystems, namely subsystem A and subsystem B.…So type self._subsystem_A…assignment SubsystemA,…self._subsystem_B…assignment SubsystemB.…
The next step is to define or simplify the interface…to represent the more complex subsystem methods.…In this scenario, we have four such methods,…two of which belong to the respective subsystems.…Let's start with the two methods belonging to subsystem A.…Call them by typing self._subsystem_A.method1.…
I'm just going to copy and paste.…Instead of method1, now it's method2.…And we do the same for subsystem B.…Copy.…Paste.…Change it to subsystem_B.…Finally, let's create a Facade class,…facade assignment.…
The last step is using the simplified interface…
- Architectural vs. design patterns
- Why use design patterns?
- Design best practices
- Domain-specific patterns and security patterns
- Gang of Four design patterns
- Command, Mediator, and State
- Template method
Skill Level Advanced
1. Understanding Design Patterns: Review
2. Design Best Practices
3. Gang of Four (GoF) Patterns, Part 1
4. Gang of Four (GoF) Patterns, Part 2
Next steps1m 26s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
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.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.