4 ms·
This is not what I understand a leaking (or more commonly 'leaky') abstraction to mean. Instead, assume the previously mentioned Logger does internally write t
by dancek 9y ago
This is not what I understand a leaking (or more commonly 'leaky') abstraction to mean.
Instead, assume the previously mentioned Logger does internally write to a file. Now, when the disk becomes full, Logger throws an exception and the caller must do something about it. The abstraction of just writing anything to log is broken and the underlying complexity leaks through.
This example also demonstrates the difficulty of keeping abstractions from leaking. You can't exactly make the code automatically free up disk space or sign up to a remote logging service when disk space runs out.
- deleted 9y ago[deleted]
- d3ckard 9y agoWell, you're right, I misused the term a bit. I used 'leaky', because it well describes that abstraction cannot hide implementation details(and in the second example those implementation details are used to achieve new functionality). However, it is because of the user abusing abstraction, not because abstraction is inherently leaky in that regard(and that is the reason the term was coined). I definitely need a new word for situations like this.