bufferapp / android-clean-architecture-boilerplate Goto Github PK
View Code? Open in Web Editor NEWAn android boilerplate project using clean architecture
License: MIT License
An android boilerplate project using clean architecture
License: MIT License
According to this talk : https://www.youtube.com/watch?v=Nsjsiz2A9mg
Uncle bob says that a project's structure should not be MVC or MVP, MVVM...,
But this project top structure is mobile-ui/presentation/domain/data...,
Programmers cannot know what is this app doing at first glimpse, could you tell me what do you think about this? I am so confused. Thank you!!
Looks like
https://joe-birch-dsdb.squarespace.com/s/team-abk9.json
is not there anymore...
Hi, i have a question. Why did you introduce DataStore
classes, instead of using DataSource
itself?
What is the gain of adding one more abstraction, DataSource
is already interface and Repository
would not be depended on Implementation any way?
Hello!
Once again thank you for this project.
I've realised you are using @Inject constructor' to the
BrowseBufferoosPresenterIs this gonna be neccesary somewhere? I mean, you're well providing the presenter dependency from the
BrowseActivityModule. You'll never be able to inject the presenter withouth its module because the
BrowseBufferoosContract.View` has to be provided through a module.
Regards!
App can't load data from the URL , gives 404 https://joe-birch-dsdb.squarespace.com/s/team.json
Presentation gradle has :
def presentationDependencies = rootProject.ext.cacheDependencies
def presentationTestDependencies = rootProject.ext.cacheTestDependencies
but I guess that this has to be something like :
def presentationDependencies = rootProject.ext.presentationDependencies
def presentationTestDependencies = rootProject.ext.presentationTestDependencies
Also in dependencies.gradle, presentationDependencies has to be changed to provide only the necessary libraries.
There is invalid import in BufferooApplication.kt
import android.support.v4.BuildConfig
I have a question
the data model that are using for sending between activity/fragment live?
the data model most likely domain's data model but it's can be serialized/Parcelized
Thank you for creating this awesome project and the lovely documentation and art!
I am worried about the best way to include or start a derived professional app using AL 2.0.
I know the licenses are compatible, but I would like to do it correctly and don't delete the docs.
So new developers that continue the project understand the architecture easily and check changes.
I want to avoid starting from scratch, so I would like to:
I am going to use this project in my personal apps, but I am worried about apps for clients.
I am planning to contribute so guidelines about style and this topic would be appreciated.
Well, let's start with Coroutines instead of RXJava2. Hey joe I got a job with your Caster course on Clean Architecture, so I would like to give back, now that have two years and half real working experience, if someone is in to review the code I am all in to contribute to your project, as I read on twitter you want to give it but do not have time to work on that.
I don't know if this is a mistake but I want to ask:
Usually, in apps, there are some tasks that we run in the background, such as syncing of data, analytics etc. Google suggested to use deferrable components such as WorkManager and JobScheduler in such instances.
Where do these components fit in Clean Architecture?
I see modularization by layer. How would package/modularize by feature to improve build speeds fall into this?
I hit this confusion at first when I'm reading BufferooDataStoreFactory
and this is because the class depends on both BufferooCache and BufferooCacheDataStore
, where I think it could only depends on BufferooCacheDataStore
. we can access the BufferooCache instance from it, to be able to use isCached()
or isExpired()
and my last question wouldn't be better to just define remote and cache requirements on DataStore interfaces and removing BufferooCache
and BufferooRemote
? .. I think this will make things simpler.
what is the purpose of BufferooCache and BufferooRemote?
First of all, congratulations for this fantastic project.
This is an easy one: The comment I mentioned is wrong. It seems that it's been copied from method fun dispose()
Regards,
Javi.
Plugin requires Android Studio 3.0.0 minimum, please fix it
I want to add a child fragment to my fragment, but I can not figure out how to do it. Is there some body can help me ? Pleazzzzzzz
If you were to implement the same framework in Kotlin coroutines instead of using RxJava2 to avoid callbacks (onSuccess, onError) from presenter, how will you do it? Just curious.. :)
Cheers,
Ren
The use cases assume the caller is also the receiver of the data. In most cases, the presenter will call the use case and wait for the result to return for display purposes.
This is mostly true but there are circumstances when it is not what is wanted. For example, my app has chat functionality which uses a websocket. Incoming messages from the server are received in a Socket class in my data module. I could call a use case to deal with it but (a) it seems dirty that such a low level class is using a use and (b) the result of the use case should notify the presenter (if running) about the event.
Any ideas how to deal with this?
Another issue is that by default, the presenter is running on the UI thread so returning data is also on the UI thread (enforced by the use case infrastructure). However, further processing such as domain model to view model can be required and it would be done on the UI thread by default.
Maybe the thread management should remain with the presenter and the use case is oblivious?
It looks like we're just creating an empty disposable in this class and disposing of it in unsubscribe
without ever changing its value. In the SingleUseCase
class, we pass an observer into the execute
method and capture a reference to the subscription by subscribing inside of thhat method. I would have expected the same to happen in this class, or if the idea is that we subscribe manually from our presenter, shouldn't we also unsubscribe manually and remove this unsubscribe
method altogether?
abstract class CompletableUseCase<in Params> protected constructor(
private val threadExecutor: ThreadExecutor,
private val postExecutionThread: PostExecutionThread) {
// Here we initialize subscription as an empty disposable
private val subscription = Disposables.empty()
protected abstract fun buildUseCaseObservable(params: Params): Completable
// I would have expected an observer to be passed into execute so that we can
// subscribe in this method and obtain a reference to the subscription
fun execute(params: Params): Completable {
return this.buildUseCaseObservable(params)
.subscribeOn(Schedulers.from(threadExecutor))
.observeOn(postExecutionThread.scheduler)
}
// Now we unsubscribe from our empty disposable
fun unsubscribe() {
if (!subscription.isDisposed) {
subscription.dispose()
}
}
}
I think there is some problem here. If I understand it correctly when the factory.retrieveDataStore()
returns the BufferooCacheDataStore
then this code is just taking the data from the cache and again storing it in the cache and updating LastCacheTime
.
This does not feel right. Is this intended behavior or some sort of issue?
Hi,
I wonder how does BrowseAdapter
inject automatically without any @Provide
method?
/**
I have implemented the gradle dependency template from the project and after a while I noticed that you dont get prompted anymore about new versions. AS doesn't recognise the patterns since it is broken down to multiple variables. Is this something we will have to learn to ignore or is there a way to make it work again without reverting to hardcoded dependencies?
The layer defines the Bufferoo class but no mapper. This is because the Domain layer is our central layer, it knows nothing of the layers outside of it so has no need to map data to any other type of model.
Is there a detailed reason why the Domain Has no Mappings?
wouldn't a Bufferoo fetched from an external source need to be mapped to a Bufferoo in the domain?
I want to create one fragment in BrowseActivity.how to rpovide depedancy to that fragment
Hello there. I was thinking after seeing a lot of repositories that usually the presenter or viewModel maps the domain models to presentation (there are no UI models) but this has a lot of problems (I shouldn't reference any platform resource, jetpack compose, etc). Even thinking in multiplatform this can be a huge problem.
Then I found this repo where I can see that the UI is separated from presentation so this problem is solved. But then I thought that really the presentation models will be the same than domain models.
Why should I keep the presentation models instead of using domain models directly until I reach the UI layer?
Hi,
Thank you for such interesting project sample.
There seems to be a problem with androidTest from mobile-ui module. It doesn't seem to work on KitKat version of OS.
java.lang.NoClassDefFoundError: org.buffer.android.boilerplate.ui.test.TestRunner$onCreate$1
at org.buffer.android.boilerplate.ui.test.TestRunner.onCreate(TestRunner.kt:14)
The missing class occurs to be RxJavaPlugin class.
Hello guys !!
I've seen that BrowseActivitySubComponent is not used and only makes the dependency injection with Dagger harder to understand.
Maybe we can remove this file.
Thanks for this amazing project.
Looking at the diagram it seems like Mobile-UI depends only on presentation module. When I actually dived into the code, that is not really the case. Mobile-UI depends on 4 out of 5 modules in the project. As far I could understand the necessity of other modules except the presentation one is because of the injection package we have inside Mobile-UI module.
What I was curious about is that if we could make different module for injection which will depend on all modules and providing the necessary injection required for each module. Doing that we can limit the usage of modules other than presentation from Mobile-UI modules. Which will also separate the concerns in a good day.
Hi, I'm new on Clean architecture and we are planning to convert our project(MVP) to Clean architecture and I'm making POC project from our code base and see how it goes for my team.
as the sample code, the data fetch from the cache only the cache not expired or cached in our case is fetch the data from cached when fetching the data from network failed whatever case.
Any ideas?
Hi, one question related to domain project/module...
Can you explain a little bit more what is a reason that use-cases and domain logic are in
the same module, shouldn't it be more appropriate to separate use-cases to application layer
and domain entities with all their logic to domain layer... This way the domain layer is
shareable as enterprise-wide rules....
More on stackexchange: Application layer vs Domain layer
Hello, I figured that you set presenter in BrowseActivity using dagger injection and method setPresenter() which I think would be redundant becouse of using dagger. Maybe you can correct me, if I'm mistaken.
Also I'm pretty excited about this article with new vision of clean architecture, and your second topic with new architecture components from google is good too. Nice work!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.