broadcast: parameterise store access in broadcast functionality

Issue #258 resolved
Saxon Milton created an issue

From issue #257 we wish to increase modularity and testability of broadcast related functionality. As part of this, we wish to stop hardcoding usage of the “settingStore” and instead have functions use a “store” parameter of the interface type “iotds.Store”. This will allows us to swap out the settingStore implementation with other implementations depending on our desires, for example, we’ll be able to use dummyStore for testing purposes.

Comments (7)

  1. Alan Noble

    Alternatively, this could be achieved be modifying VidGrind’s setup function, where settingsStore is initialized, rather than replacing all instances of settingsStore.

  2. Saxon Milton reporter

    That could be a solution, but it feels like an abstraction leak. The broadcast stuff doesn’t need to depend on vidgrind’s setup function. It’s kind of annoying that we’ll have many of the broadcast related functions with a iotds.Store parameter, but I think we’d probably soon have a broadcastHandler struct that can hold onto this, and all the broadcast related functions would become methods of this struct.

  3. Alan Noble

    I like the idea of a broadcast handler, or BroadcastManager, that encapsulates storage (and other details).

  4. Saxon Milton reporter

    Merged in store-parameterisation (pull request #248)

    broadcast: parameterise datastore value

    Resolves issue #258

    This change parameterises the store value as opposed to hardcoding the globally available settingsStore into functionality. We're doing this by adding a store parameter of iotds.Store type to broadcast related functions.

    This change also involves updating of testing to accomodate these changes.

    Approved-by: David Sutton Approved-by: Trek Hopton

    → <<cset d16de4994385>>

  5. Saxon Milton reporter

    Merged in store-parameterisation (pull request #248)

    broadcast: parameterise datastore value

    Resolves issue #258

    This change parameterises the store value as opposed to hardcoding the globally available settingsStore into functionality. We're doing this by adding a store parameter of iotds.Store type to broadcast related functions.

    This change also involves updating of testing to accomodate these changes.

    Approved-by: David Sutton Approved-by: Trek Hopton

    → <<cset 01771eb9b143>>

  6. David Sutton

    Merged in store-parameterisation (pull request #248)

    broadcast: parameterise datastore value

    Resolves issue #258

    This change parameterises the store value as opposed to hardcoding the globally available settingsStore into functionality. We're doing this by adding a store parameter of iotds.Store type to broadcast related functions.

    This change also involves updating of testing to accomodate these changes.

    Approved-by: David Sutton Approved-by: Trek Hopton

    → <<cset 080b081d58bd>>

  7. Log in to comment