Exercise 2: Adding end_movie() With Reversed Shutdown Order — Possible Solution ==================================================================== THE NEW FACADE METHOD ------------------------------ def end_movie(self): self.dvd.off() self.proj.off() self.amp.off() This calls each component's own off() method (added alongside the existing on() methods this chapter already used) in exactly the reverse order the components were originally turned on in watch_movie(): the original startup order was amp, then proj, then dvd, so shutdown correctly reverses that to dvd, then proj, then amp. VERIFYING THE CALL LOG MATCHES THE EXPECTED REVERSED ORDER ------------------------------ Calling theater.end_movie() produces exactly this call log, in this order: DVDPlayer.off() Projector.off() Amplifier.off() This matches the intended reversed order precisely - the last component turned on (DVDPlayer, turned on third during watch_movie()) is the first one turned off, and the first component turned on (Amplifier, turned on first during watch_movie()) is the last one turned off. WHY REVERSING THE ORDER IS THE SENSIBLE CHOICE HERE ------------------------------ Turning off components in reverse startup order is a common, sensible convention for shutdown sequences generally - each component is only switched off once nothing still depends on it being on, mirroring the same "last in, first out" discipline used when unwinding a sequence of operations. While this chapter's own simple example doesn't have a strict dependency requiring this order specifically, it demonstrates the Facade correctly encapsulating not just WHICH calls to make, but also the RIGHT ORDER to make them in - exactly the same value watch_movie() itself already provided for startup. WHY THIS WORKS AS AN ANSWER ------------------------------ The new method correctly reverses this chapter's own established startup order, the resulting call log is verified directly rather than assumed, and the explanation connects the reversed-order design choice back to the same "hide the correct sequence, not just the correct calls" value this chapter's own watch_movie() method already demonstrated.