Giter Club home page Giter Club logo

Comments (3)

rcedwards avatar rcedwards commented on July 4, 2024

@lyricsboy is something like this what you had in mind?

cc19a97

from coredatastack.

lyricsboy avatar lyricsboy commented on July 4, 2024

I like the separation of the different specializations into protocols. There are a few things we might consider here:

First, how does a "user" of CoreDataStack think about this and use it? Do they talk to a single interface, or an amalgamation of them provided by these protocols?

As one might look like:

let coreDataStack: CoreDataStack

Where CoreDataStack could be a protocol instead of a concrete type, such as:

protocol CoreDataStack: ThreeTierStack, SQLiteBackedStack, BatchOperationStack { ... }

As many, perhaps:

let coreDataStack: protocol<ThreeTierStack, SQLiteBackedStack>

For mocking/faking purposes, in general I want to be able to have as simple an interface as possible that I can stub out.

But for CoreData land and testing, it might be more sensible for me to be able to have a dependency (of a protocol type) that could be satisfied by either a SQLite stack (for production use) or an in-memory one (for testing). It's probably easier to go with the in-memory stack for testing rather than try to completely stub core data.

In order to satisfy that, I would expect only a single interface (protocol) and a way to inject that into my System Under Test. The asynchronous construction pattern we're using here complicates the problem a little, though...

from coredatastack.

lyricsboy avatar lyricsboy commented on July 4, 2024

Based on discussion with @rcedwards we're going to close this for now, in favor of making the SQLite and in-memory store configurations more compatible with each other. (See #27)

from coredatastack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.