Giter VIP home page Giter VIP logo

Comments (8)

anstaendig avatar anstaendig commented on May 16, 2024

The repository is meant for passing data to and from the domain layer whereas DataSources are for pure data operations. The way I see it a Repository has a one-to-many relation to DataSource hence the abstraction? That's just my opinion though.

from android-clean-architecture-boilerplate.

jemshit avatar jemshit commented on May 16, 2024

@anstaendig you got it wrong, i asked why there is DataStore, why not just DataSource

from android-clean-architecture-boilerplate.

anstaendig avatar anstaendig commented on May 16, 2024

Wait, am I mixing something up here? There's no such thing as a DataSource interface?! Can you clarify?

from android-clean-architecture-boilerplate.

jemshit avatar jemshit commented on May 16, 2024

In this pic, you can see it. In code, they should be BufferooCache and BufferooRemote
Why not this approach ?

from android-clean-architecture-boilerplate.

anstaendig avatar anstaendig commented on May 16, 2024

Ah, now I get it. I think the reason is that with one more layer of abstraction you have the freedom to implement the DataSources in different ways and then have one interface via the DataStore. With the approach you mentioned all DataStores have the same interface. The approach in here has the flexibility to have different interfaces for cache and data.

I hope I did not mix up things again but now it seems plausible :D

from android-clean-architecture-boilerplate.

jemshit avatar jemshit commented on May 16, 2024

With approach i mentioned, you only may have some empty methods in Local or Remote DataSource. But to overcome that, introducing one more abstraction and 2 different interfaces does not look attractive to me :)

from android-clean-architecture-boilerplate.

hitherejoe avatar hitherejoe commented on May 16, 2024

This is optional. If you have one interface shared between the cache and remote stores then you could end up having a lot of unused methods. The difference between the cache interface and the remote interface is quite a lot, meaning that they'd be a lot of unused bloat in the remote implementation class. THis is likely just personal preference though, no big deal what you go for either way :)

from android-clean-architecture-boilerplate.

jemshit avatar jemshit commented on May 16, 2024

Ok 👍

from android-clean-architecture-boilerplate.

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.