iluwatar / iluwatar/java-design-patterns

Dependency Command pattern

Open
#439 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

epic: pattern info: help wanted type: feature
Dominant language
Java
Stars
94.7k
Forks
27.4k
Avg merge
3d 4h
Merged PRs (30d)
10

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the Project Contribution Guidelines and the referenced Netflix fault-tolerance article. Define the Command interface, sample concrete commands, dependency-aware executor, and fallback behavior described in the acceptance criteria. Done means these components are implemented and demonstrate ordered execution with resilience to command failures.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.