rlkoshak
(Rich Koshak)
February 9, 2017, 7:37pm
1
What Is a Design Pattern (DP)
[image]
A DP is a concept borrowed from software engineering that is in turn borrowed from architecture. A DP is a general and reusable solution to a common problem. But the solution is not complete. Instead it is a template that one can apply to a lot of different situations with minor modifications and customizations.
The DPs posted to this forum will usually include a complete solution as an example implementation of the DP. But do not assume that the DP is onl…
Problem Statement
Sometimes a user wants to perform some sort of action or activate polling during a certain period of time after another event occurs.
This Design Pattern is deprecated. Please see Design Pattern: Looping Timers for a better approach.
9 Likes
rlkoshak:
val start = now
Why not more efficiently val end = now.plusMinutes(10)
?
rlkoshak
(Rich Koshak)
February 10, 2017, 3:03pm
3
Because I was in a hurry and clearly didn’t think it through.
That is better. Editing the original.
1 Like
mrfrh
(Martin)
June 12, 2019, 5:14am
4
This always gave me syntax errors, as “end” is a reserved keyword? I ended up using another name for the variable “end”, then the example works fine.
rlkoshak
(Rich Koshak)
June 12, 2019, 2:09pm
5
Thanks, but really I should remove Example 2. You should not have a long running Rule like that. It can be really bad . Use Design Pattern: Looping Timers instead.