iluwatar / iluwatar/java-design-patterns
Dependency Command pattern
Nobody has claimed this yet.
- 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:
- Command Interface: Defines the contract for executing operations.
- Concrete Commands: Implement the Command interface and define the actual business logic for various operations.
- Command Executor: Responsible for executing the commands and managing dependencies between them.
- Dependency Graph: Represents the dependencies between commands to ensure they execute in the correct order.
- 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:
- Project Contribution Guidelines
- Netflix Tech Blog: Fault Tolerance in a High Volume Distributed System
Acceptance Criteria:
- Implement the Command interface and a few sample Concrete Commands demonstrating different operations.
- Develop a Command Executor that handles the execution and manages the dependencies between commands.
- Include a fallback mechanism to provide resilience in case of command execution failures.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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