iluwatar / java-design-patterns

Design patterns implemented in Java
https://java-design-patterns.com
Other
89.56k stars 26.48k forks source link

Dependency Command pattern #439

Open iluwatar opened 8 years ago

iluwatar commented 8 years ago

Description:

The Dependency Command design pattern is essential for managing dependencies and executing commands in a distributed system. This pattern helps in building fault-tolerant applications by isolating points of access to remote systems, services, or resources. The primary elements of this pattern include:

  1. Command Interface: Defines the contract for executing operations.
  2. Concrete Commands: Implement the Command interface and define the actual business logic for various operations.
  3. Command Executor: Responsible for executing the commands and managing dependencies between them.
  4. Dependency Graph: Represents the dependencies between commands to ensure they execute in the correct order.
  5. Fallback Mechanism: Provides alternative commands or responses when the primary command fails, ensuring system resilience.

This pattern is particularly useful in high-volume distributed systems where failure is not an option. It ensures that commands with dependencies are executed in the correct sequence, and fallback mechanisms are in place to handle potential failures gracefully.

References:

  1. Project Contribution Guidelines
  2. Netflix Tech Blog: Fault Tolerance in a High Volume Distributed System

Acceptance Criteria:

  1. Implement the Command interface and a few sample Concrete Commands demonstrating different operations.
  2. Develop a Command Executor that handles the execution and manages the dependencies between commands.
  3. Include a fallback mechanism to provide resilience in case of command execution failures.
mohanaraosv commented 6 years ago

I would like to work on this pattern

iluwatar commented 6 years ago

Ok @mohanaraosv

iluwatar commented 5 years ago

The task is free for anyone to work on