iluwatar / iluwatar/java-design-patterns

Collector State Pattern

Open
#394 16 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

  • #1769 by @Laurels7 — closed without merging
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 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:

  1. Implement the basic structure of the Collector State design pattern, including the Collected Message Handler and Timeout Handler.
  2. Provide a working example demonstrating the usage of the Collector State pattern with unit tests to ensure functionality.
  3. Ensure the implementation adheres to the project's contribution guidelines as outlined in the java-design-patterns wiki.

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.