Unanswered Questions
25
votes
0answers
2k views
Why (or why not) are existential types considered bad practice in functional programming?
What are some techniques I might use to consistently refactor code removing the reliance on existential types? Typically these are used to disqualify undesired constructions of your type as well as to ...
10
votes
2answers
473 views
In-memory datastore in Haskell
I want to implement an in-memory datastore for a web service in Haskell. I want to run transactions in the STM monad.
When I google hash table steam Haskell I only get this: Data. BTree. HashTable. ...
8
votes
0answers
271 views
How to implement a branch-and-bound in a functional programming language?
I am trying to write a branch and bound search on the set of all functions f: D -> R, where the domain size is small (|D| ~ 20) and the range is much bigger (|R| ~ 2^20). Initially, I came up with the ...
8
votes
1answer
741 views
Useful design patterns for working with FragmentManager on Android
When working with fragments, I have been using a class composed of static methods that define actions on fragments. For any given project, I might have a class called FragmentActions, which contains ...
6
votes
1answer
217 views
How to hide AOP implementation dependency without breaking encapsulation?
I have the concept of a SlowLoading thing:
public interface SlowLoading {
boolean hasLoaded();
}
I also have a component MyComponent:
public interface myComponent{
void doSomething();
}
My ...
6
votes
0answers
128 views
Using uniqueness types to implement safe parallelism
I've been interested in uniqueness types as an alternative to monads in pure functional languages for some time; unfortunately, this is kind of an esoteric area of CS research and online resources ...
6
votes
1answer
148 views
Heuristic Approach for Flexible DIFF Implementation
I have created a DIFF implementation to compare document revisions at work. It is based on An O(ND) Difference Algorithm and Its Variations.
One thing that has become important is to take the list ...
5
votes
1answer
619 views
Attachment handling for web application with Jackrabbit
I need to manage attachments on my Spring web application and I thought to use an open source repository.
My app it's a job approval system using J2EE / SPRING 3 Framework and Postgress DB to allow ...
5
votes
4answers
338 views
Adding field to the class at runtime - design pattern
Imagine your customer want's to have a possibility to add new property (e.g. color) to product in their eshop in their CMS.
Instead of having properties as fields:
class Car extends Product {
...
4
votes
3answers
64 views
Returning results of method on batch list?
The title is a bit vague so I'll try to elaborate.
I have a function
makeFoo(int bar) -> returns Foo or throws Exception.
I also have a batch version of this
makeFoos(int[] bars) -> ...
4
votes
3answers
111 views
Using mocks to set up object even if you will not be mocking any behavior or verifying any interaction with it?
When building a unit test, is it appropriate to use a mocking tool to assist you in setting up an object even if you will not be mocking any behavior or verifying any interaction with that object?
...
4
votes
1answer
209 views
What are the benefits of Android way of “saving memory” - explicitly passing Context objects everywhere?
Turned out, this question is not easy to formulate for me, but let's try.
In Android, pretty much any UI object depends on a Context, and has defined lifetime. Android can also destroy and recreate UI ...
4
votes
1answer
696 views
Help with complex MVVM (multiple views)
I need help creating view models for the following scenario:
Deep, hierarchical data
Multiple views for the same set of data
Each view is a single, dynamically-changing view, based on the active ...
4
votes
1answer
265 views
Loose Coupling Presenter to View in MVP
We work in a Java shop here and our web application uses an implementation of the MVP architectural pattern. Our manager comes from a .NET world, where he has been exposed to the MVVM design pattern. ...
4
votes
2answers
536 views
Acceptable placement of the composition root using dependency injection and inversion of control containers
I've read in several sources including Mark Seemann's 'Ploeh' blog about how the appropriate placement of the composition root of an IoC container is as close as possible to the entry point of an ...