Reliability

Fallback Pattern

Description

Providing a backup plan or default value when a service fails.

Where to use

  • UX.
  • \n
  • Resilience.

Real World Example

If the movie poster service is down, show a generic placeholder image.

Code Example

class FallbackPattern:\n    def __init__(self):\n        pass\n\n    def execute(self):\n        print('Executing Fallback Pattern')