4 ms·
It does double your API surface area, so that's the tradeoff you'll have to consider. It can be the correct decision in a lot of cases.
by yen223 3y ago
It does double your API surface area, so that's the tradeoff you'll have to consider. It can be the correct decision in a lot of cases.
- Pxtl 3y agoIt doesn't double the security surface area if the abstracted API goes through the low-level API. The outer one is just chrome, and so the risks of screwing something up there is far lower. Unless you're using a trash language where even simple wrappers could buffer underrun or something.
- lmz 3y agoIsn't there the issue of modifying the state enough through the low-level API such that it breaks the assumptions of the high-level one?
- eru 3y agoJust say that you don't support mixing both APIs.
- lazyasciiart 3y agoNow you’re telling users to check the source code of any tools they use with your stuff? “We recommend using ToolOne only on content you do not also manage with ToolTwo”
- eru 3y agoSee how libfuse handles it with their low level and high level APIs.
- actionfromafar 3y agoThat’ll fix it. ;-)
- withinboredom 3y agoThe high level API shouldn’t care about state. In other words, your “readers” should merely aggregate state and your “writers” should only care about subsets of state. Think about file permissions in Linux. Running ls just shows you gross file perms (current user, group, and global) but you can also grant access to other individual users, or even make a file immutable that still shows up as writable to ls. The high level api doesn’t know or care about the low level state except where it is relevant.
- Pxtl 3y agoYes. But that's the high-level API's problem. That's a problem with any abstraction really. "What if there's something in the thing we're abstracting that doesn't fit the abstraction" isn't really a problem with the "two API" approach, it's a problem with abstraction. The high-level API needs to handle that case, if nothing better than having internal assertions that throw if it hits a case it's not designed to accommodate. (also I'm annoyed with myself that I wrote buffer underrun in my first post instead of buffer overflow and now it's too late to edit).
- cylemons 3y agoYou did make me search what a buffer underrun was and I think it was a good read
- deleted 3y ago[deleted]
- campbel 3y agoUnlikely to double. The low level API exposes all capabilities, the high level API exposes a subset of those capabilities under a smaller surface. The high level API will not be as large as the low level.
- deleted 3y ago[deleted]
- blowski 3y agoThis reminds me of the Kubernetes API.
- IggleSniggle 3y agoThis reminds me of the git API.