All Questions
Tagged with control-structures design-patterns
5 questions
3
votes
1
answer
153
views
Is there a pattern for choosing one of a set of options at random when their selection criteria are equal?
I want to choose between several options, and if the criteria I'm using for selection happen to be equal, I want one at random (reasonably so, so it's equal-chance each time, rather than arbitrary). ...
4
votes
4
answers
156
views
Is there a pattern for dealing with one consistent case that's different from all others?
Been given an awkward design challenge, and I'm not sure how best to handle it.
The scenario is this: in the system there's a concept of "Client". Each client has various bits of supporting metadata ...
8
votes
1
answer
680
views
Is this a valid design pattern for a Haskell main function?
After developing several Haskell applications I've found myself rigorously segregating impure code and failable (partial) functions from their pure & total counterparts. These efforts have ...
6
votes
5
answers
418
views
design for interruptable operations
I couldn't find a better topic but here it is;
1) When user clicks a button, code starts t work,
2) When another button is clicked, it would stop doing whatever it does and start to run the second ...
3
votes
2
answers
281
views
Is it dangerous for me to give some of my Model classes Control-like methods?
In my personal project I have tried to stick to MVC, but I've also been made aware that sticking to MVC too tightly can be a bad thing as it makes writing awkward and forces the flow of the program in ...