Timeline for Why does "a consistent, understandable interface" differentiates database from global states?
Current License: CC BY-SA 4.0
11 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Apr 13, 2024 at 12:05 | comment | added | Steve | @DocBrown, I'm inclined to agree with Basilevs that "global" and "local" only describes the scope of accessibility, not lifetimes. If you were describing state with a lifetime longer than a single process, you would probably use words like "durable", "persistent", or "saved". Within a process, you might say the allocation is "static", "heap", or "stack" to refer to broad categories of lifetime. And if you're describing state accessible outside a single process, you'd usually use the word "shared". | |
| Apr 11, 2024 at 11:33 | history | edited | Basilevs | CC BY-SA 4.0 | added 1 character in body |
| Apr 11, 2024 at 11:27 | comment | added | Basilevs | I would say global to describe a subject shared to the extreme. | |
| Apr 11, 2024 at 11:16 | comment | added | Basilevs | I have not see non-abstract database handles in the wild, so I imagined abstract one when authoring the answer. I will consider making that explicit. | |
| Apr 11, 2024 at 11:14 | comment | added | Basilevs | We disagree that "global" adjective describes lifetime, hence the confusion. "Global" describes accessibility only ("local" too, but given lifetime of local scopes, it implies the short lifetime too). | |
| Apr 11, 2024 at 11:02 | comment | added | Doc Brown | ... however, a database handle is not what I would call an explicit, replaceable interface to a database, it is not the kind which can be easily replaced by a mock implementation suitable for tests. If we want testable components which are decoupled from a database, a database handle in the interface does not help. | |
| Apr 11, 2024 at 11:00 | comment | added | Doc Brown | State which is restricted to a local scope isn't global. Global state is state with a lifetime at least as long as the program or process. Global accessibility means a component inside a program uses unrestricted, implicit access to the global state, so one cannot see from the public interface of the component that it accesses global state. When access to a database requires a component to get a database handle reference first through it's public API, then we can easily distinguish between components which access the database, and those which do not ... | |
| Apr 11, 2024 at 9:56 | comment | added | Basilevs | I've replaced "global" with "shared" to place the implication better | |
| Apr 11, 2024 at 9:55 | history | edited | Basilevs | CC BY-SA 4.0 | edited body |
| Apr 11, 2024 at 9:49 | comment | added | Basilevs | @DocBrown what state is not "global"? We always talk about accessibility. | |
| Apr 11, 2024 at 6:51 | history | answered | Basilevs | CC BY-SA 4.0 |