iluwatar / iluwatar/java-design-patterns
Collector State Pattern
Nobody has claimed this yet.
- #1769 by @Laurels7 — closed without merging
- Dominant language
- Java
- Stars
- 94.7k
- Forks
- 27.4k
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 10
Description
Description:
The Collector State design pattern is a behavioral design pattern used in real-time software to manage scenarios where a sequence of messages needs to be collected before initiating further actions. Key elements include:
- Collected Message Handler: Receives and processes messages, starts and stops timers, and decides when the collection is complete.
- Timeout Handler: Manages timeout events, determining the status of the collection (success or failure).
This pattern is particularly useful in situations like digit collection for call routing, where messages are collected and processed based on specific conditions and timeouts.
References:
Acceptance Criteria:
- Implement the basic structure of the Collector State design pattern, including the Collected Message Handler and Timeout Handler.
- Provide a working example demonstrating the usage of the Collector State pattern with unit tests to ensure functionality.
- Ensure the implementation adheres to the project's contribution guidelines as outlined in the java-design-patterns wiki.
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 reading the Collector State Pattern reference and the Java Design Patterns contribution guidelines. Define the Collected Message Handler and Timeout Handler, then add a working example and unit tests covering collection completion and timeout success or failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100