java-design-patterns
java-design-patterns copied to clipboard
Collector State Pattern
http://www.eventhelix.com/RealtimeMantra/PatternCatalog/CollectorStatePattern.htm
Realtime software sometimes involves collecting a sequence of messages. Further action can be initiated only after complete sequence of messages has been received. Collector state pattern handles such scenarios.
Intent
The main intention here is to manage sequence of events of same type. For example, a Call object needs to collect all the digits to perform call routing. This will involve activities like a timer start before each digit, digit collection, timer stop at each digit collection, timeout on complete digit collection and call routing on complete digit collection.
Also Known As
Digit Collection Design Pattern Message Assembly Design Pattern
I guess, I can do this. What is the deadline then? I usually have 2 hr free time per day.
@zhexuany there are no deadlines. Take your time and create a pull request when you're ready for review. Let us know if you need help via this issue or Gitter.
@iluwatar Nice. I will work on this issue when I am free. ;)
@zhexuany are you making progress?
This issue is free for taking again.
Hey, @iluwatar looks like nobody commented to take this issue up.
But I can see that @Mediocrity7 started working on this thing, and @Laurels7 has already submitted a PR #1769 for this, what should we be doing?
To me, it seems the consensus is that we should review the PR made by @Laurels7 here https://github.com/iluwatar/java-design-patterns/pull/1769
Updated link to the pattern description: https://www.eventhelix.com/design-patterns/collector-state/
Hi, may I attempt to get this working? It will take a little time though.
@iluwatar I was looking through the past progress of this issue, and was wondering if I could get an elaboration on what you meant by "threaded messages that sends multiple stateless messages" - https://github.com/iluwatar/java-design-patterns/pull/1769/commits/1324c0d0753f1af0a816172c4eb847cad2f8c4b1#r643438460
@DoopTheSoup the message passing mechanism is one of the core parts of this pattern. I think there should be the sender and the message collector components. I suggest that you take a look how this has been implemented in producer-consumer pattern.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.