Questions tagged [leaky-abstraction]

A leaky abstraction is an implemented abstraction where details and limitations of the implementation leak through.

Abstractions leak due to many reasons, some of which are unforeseen platform compatibility issues, false assumptions, poor API design, and API deprecation.

References

18 questions
95
votes
11 answers

Meaning of Leaky Abstraction?

What does the term "Leaky Abstraction" mean? (Please explain with examples. I often have a hard time grokking a mere theory.)
13
votes
8 answers

Fluent interfaces and leaky abstractions

What is a fluent interface? I can't find a good definition of this, but all I get are long code examples in a language I am not very familiar with (e.g. C++). Also, what is a leaky abstraction? Thanks
GurdeepS
  • 58,809
  • 95
  • 236
  • 371
10
votes
1 answer

Does MVC Contrib fulfill its promise of increasing productivity in ASP.NET MVC

I am knee deep in starting a new ASP.NET MVC project. Several tutorials have recommended the use of MVC Contrib. I wanted to get the opinion of the Stack Overflow community if it fulfilled its promise of increasing productivity with ASP.NET MVC.…
ahsteele
  • 25,470
  • 26
  • 131
  • 238
7
votes
2 answers

C++: push_back in std::vector while iterating it

Following code snippet provides a very weird output. I was expecting an overflow( Python gives a MemoryError) #include #include int main() { std::vector a{1,2,3}; for( auto const & item : a) …
jha-G
  • 1,944
  • 14
  • 29
7
votes
0 answers

Is there evidence to suggest Thoughtworks' assertion that JSF is a broken abstraction?

On the Thoughtworks Technology radar - they put Java Server Faces on Hold - stating: We continue to see teams run into trouble using JSF -- JavaServer Faces -- and are recommending you avoid this technology. Teams seem to choose JSF because it is a…
hawkeye
  • 31,052
  • 27
  • 133
  • 271
6
votes
2 answers

N-layered database application without using an ORM, how does the UI specify what it needs of data to display?

I'm looking for pointers and information here, I'll make this CW since I suspect it has no single one correct answer. This is for C#, hence I'll make some references to Linq below. I also apologize for the long post. Let me summarize the question…
Lasse V. Karlsen
  • 350,178
  • 94
  • 582
  • 779
5
votes
3 answers

Should I use integer ID or pointers for my opaque objects?

I'm writing an abstraction layer on top of some graphics API (DirectX9 and DirectX11) and I would like your opinion. Traditionally I would create a base class for each concept I want to abstract. So in typical OO fashion I would have for example a…
Julien Lebot
  • 3,072
  • 17
  • 31
5
votes
4 answers

C# pattern for avoiding a leaky abstraction when one of the implementation requires an extra step

I am implementing an ITracker interface that looks something like: public interface ITracker { void Track(ITrackerEvent trackerEvent); } I initially created an implementation of this interface wrapping Mixpanel.NET. I then created another one…
James Bateson
  • 829
  • 8
  • 19
5
votes
1 answer

Generic Repository and Leaky Abstraction

I am implementing a repository pattern. My main reasons for this: To abstract client code away from persistence specifics (Entity Framework) To support testability Generic Repository or not? The issue I have run into is whether I should have a…
4
votes
4 answers

Python: an iteration over a non-empty list with no if-clause comes up empty. Why?

How can an iterator over a non-empty sequence, with no filtering and no aggregation (sum(), etc.), yield nothing? Consider a simple example: sequence = ['a', 'b', 'c'] list((el, ord(el)) for el in sequence) This yields [('a', 97), ('b', 98), ('c',…
Gunnlaugur Briem
  • 2,456
  • 2
  • 20
  • 23
4
votes
1 answer

Is clojure.lang really just implementation details?

In Clojure, some tasks (such as instantiating a PersistentQueue or using deftype to implement a custom data type that is compatible with the clojure.core functions) require knowledge of the classes and/or interfaces in clojure.lang. However,…
Sam Estep
  • 12,100
  • 2
  • 30
  • 62
3
votes
1 answer

How does one best integrate with clojure abstractions?

I am implementing an ordered set in clojure, where I retrieve elements based on their rank. This means that I can retrieve the 4th element (according to the set's ordering), the 3rd, or the 7th, all in logarithmic time. In order to get my new data…
djhaskin987
  • 8,513
  • 1
  • 45
  • 81
1
vote
4 answers

Design issue: RMI needs explicit exporting of objects

I have two applications communicating via RMI, a slave server (of which there will be multiple) and a master server. Following good abstract design, I'd like to implement the slave in a way that it doesn't know that when talking to the master, it's…
Bart van Heukelom
  • 40,403
  • 57
  • 174
  • 291
0
votes
1 answer

Accessing implementation specific methods on an object that is returned to its API

Let me start by abstractly formulating the problem: I have two public interface types. One of them contains a method which receives at least two instances of the other interface type. The implementation of the method depends on the implementation of…
Stefan Dollase
  • 4,102
  • 3
  • 21
  • 47
0
votes
1 answer

Auto implicit arg stops working when type is given a name

While writing this answer, I noticed that while this works as expected: onlyModBy5 : (n : Nat) -> {auto prf : n `modNat` 5 = 0} -> Nat onlyModBy5 n = n foo : Nat foo = onlyModBy5 25 but as soon as I give a name to the property it stops…
Cactus
  • 25,576
  • 9
  • 60
  • 130
1
2