Skip to main content
added 1 character in body
Source Link
Basilevs
  • 4.5k
  • 1
  • 20
  • 33

@DocBrown is correct, but I'd like to offer a condensed revision with practical focus.

If a database is accessed via connection URI from multiple components, it is a shared mutable state. But the database handle is usually explicitly passed around, making it non-sharedless shared.

Shared variables can be easily made non-shared by reducing their visibility and explicitly passing references to them, but this is never done. Instead, they are sometimes wrapped in a Singleton, which is also a shared (and often mutable) state and achieves nothing.

@DocBrown is correct, but I'd like to offer a condensed revision with practical focus.

If a database is accessed via connection URI from multiple components, it is a shared mutable state. But the database handle is usually explicitly passed around, making it non-shared.

Shared variables can be easily made non-shared by reducing their visibility and explicitly passing references to them, but this is never done. Instead, they are sometimes wrapped in a Singleton, which is also a shared (and often mutable) state and achieves nothing.

@DocBrown is correct, but I'd like to offer a condensed revision with practical focus.

If a database is accessed via connection URI from multiple components, it is a shared mutable state. But the database handle is usually explicitly passed around, making it less shared.

Shared variables can be easily made non-shared by reducing their visibility and explicitly passing references to them, but this is never done. Instead, they are sometimes wrapped in a Singleton, which is also a shared (and often mutable) state and achieves nothing.

edited body
Source Link
Basilevs
  • 4.5k
  • 1
  • 20
  • 33

@DocBrown is correct, but I'd like to offer a condensed revision with practical focus.

If a database is accessed via connection URI from multiple components, it is a globalshared mutable state. But the database handle is usually explicitly passed around, making it non-globalshared.

Shared variables can be easily made non-globalshared by reducing their visibility and explicitly passing references to them, but this is never done. Instead, they are sometimes wrapped in a Singleton, which is also a shared (and often mutable) state and achieves nothing.

@DocBrown is correct, but I'd like to offer a condensed revision with practical focus.

If a database is accessed via connection URI from multiple components, it is a global mutable state. But the database handle is usually explicitly passed around, making it non-global.

Shared variables can be easily made non-global by reducing their visibility and explicitly passing references to them, but this is never done. Instead, they are sometimes wrapped in a Singleton, which is also a shared (and often mutable) state and achieves nothing.

@DocBrown is correct, but I'd like to offer a condensed revision with practical focus.

If a database is accessed via connection URI from multiple components, it is a shared mutable state. But the database handle is usually explicitly passed around, making it non-shared.

Shared variables can be easily made non-shared by reducing their visibility and explicitly passing references to them, but this is never done. Instead, they are sometimes wrapped in a Singleton, which is also a shared (and often mutable) state and achieves nothing.

Source Link
Basilevs
  • 4.5k
  • 1
  • 20
  • 33

@DocBrown is correct, but I'd like to offer a condensed revision with practical focus.

If a database is accessed via connection URI from multiple components, it is a global mutable state. But the database handle is usually explicitly passed around, making it non-global.

Shared variables can be easily made non-global by reducing their visibility and explicitly passing references to them, but this is never done. Instead, they are sometimes wrapped in a Singleton, which is also a shared (and often mutable) state and achieves nothing.