Giter Club home page Giter Club logo

clean-architecture-components-boilerplate's Introduction

Build Status codecov Codacy Badge

Android Clean Architecture Components Boilerplate

Note: This is a fork of our original Clean Architecture Boilerplate, except in this repo we have switched out the MVP approach found in the presentation layer to now use ViewModels from the Android Architecture Components Library. The caching layer now also uses Room.

Welcome 👋 We hope this boilerplate is not only helpful to other developers, but also that it helps to educate in the area of architecture. We created this boilerplate for a few reasons:

  1. To experiment with modularisation
  2. To experiment with the Android Architecture Components
  3. To share some approaches to clean architecture, especially as we've been talking a lot about it
  4. To use as a starting point in future projects where clean architecture feels appropriate

It is written 100% in Kotlin with both UI and Unit tests - we will also be keeping this up-to-date as libraries change!

Disclaimer

Note: The use of clean architecture may seem over-complicated for this sample project. However, this allows us to keep the amount of boilerplate code to a minimum and also demonstrate the approach in a simpler form.

Clean Architecture will not be appropriate for every project, so it is down to you to decide whether or not it fits your needs 🙂

Languages, libraries and tools used

Requirements

Architecture

The architecture of the project follows the principles of Clean Architecture. Here's how the sample project implements it:

architecture

The sample app when run will show you a simple list of all the Bufferoos (Buffer team members!).

Drawing

Let's look at each of the architecture layers and the role each one plays :)

architecture

User Interface

This layer makes use of the Android Framework and is used to create all of our UI components to display inside of the Browse Activity. The layer receives its data from the Presentation layer and when retrieved, the received models are mapped using the Bufferoo Mapper so that the model can be mapped to this layer's interpretation of the Bufferoo instance, which is the BufferooViewModel. The Activity makes use of the BrowseBufferoosViewModel to retrieve data.

Presentation

This layer's responsibility is to handle the presentation of the User Interface, but at the same time knows nothing about the user interface itself. This layer has no dependence on the Android Framework, it is a pure Kotlin module. Each ViewModel class that is created implements the ViewModel class found within the Architecture components library. This ViewModel can then be used by the UI layer to communicate with UseCases and retrieve data. The BrowseBufferoosViewModel returns an instance of a Resource which contains data that can be used by the UI - this includes the ResourceState, data to be used by the UI and a message if required (for error states).

The ViewModels use an instance of a FlowableUseCase from the Domain layer to retrieve data. Note here that there is no direct name reference to the UseCase that we are using - we do inject an instance of the GetBufferoos UseCase, however.

The ViewModel receives data from the Domain layer in the form of a Bufferoo. These instances are mapped to instance of this layers model, which is a BufferooView using the BufferooMapper.

Domain

The domain layer responsibility is to simply contain the UseCase instance used to retrieve data from the Data layer and pass it onto the Presentation layer. In our case, we define a GetBufferoos - this use case handles the subscribing and observing of our request for data from the BufferooRepository interface. This UseCase extends the SingleUseCase base class - therefore we can reference it from outer layers and avoid a direct reference to a specific implementation.

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.

The Domain layer defines the BufferooRepository interface which provides a set of methods for an external layer to implement as the UseCase classes use the interface when requesting data.

architecture

Data

The Data layer is our access point to external data layers and is used to fetch data from multiple sources (the cache and network in our case). It contains an implementation of the BufferooRepository, which is the BufferooDataRepository. To begin with, this class uses the BufferooDataStoreFactory to decide which data store class will be used when fetching data - this will be either the BufferooRemoteDataStore or the BufferooCacheDataStore - both of these classes implement the BufferooDataStore repository so that our DataStore classes are enforced.

Each of these DataStore classes also references a corresponding BufferooCache and BufferooRemote interface, which is used when requesting data from an external data source module.

This layers data model is the BufferooEntity. Here the BufferooMapper is used to map data to and from a Bufferoo instance from the domain layer and BufferooEntity instance from this layer as required.

Remote

The Remote layer handles all communications with remote sources, in our case it makes a simple API call using a Retrofit interface. The BufferooRemoteImpl class implements the BufferooRemote interface from the Data layer and uses the BufferooService to retrieve data from the API.

The API returns us instances of a BufferooModel and these are mapped to BufferooEntity instance from the Data layer using the BufferooEntityMapper class.

Cache

The Cache layer handles all communication with the local database which is used to cache data.

The data model for this layer is the CachedBufferoo and this is mapped to and from a BufferooEntity instance from the Data layer using the BufferooEntityMapper class.

Conclusion

We will be happy to answer any questions that you may have on this approach, and if you want to lend a hand with the boilerplate then please feel free to submit an issue and/or pull request 🙂

Again to note, use Clean Architecture where appropriate. This is example can appear as over-architectured for what it is - but it is an example only. The same can be said for individual models for each layer, this decision is down to you. In this example, the data used for every model is exactly the same, so some may argue that "hey, maybe we don't need to map between the presentation and user-interface layer". Or maybe you don't want to modularise your data layer into data/remote/cache and want to just have it in a single 'data' module. That decision is down to you and the project that you are working on 🙌🏻

Thanks

A special thanks to the authors involved with these two repositories, they were a great resource during our learning!

clean-architecture-components-boilerplate's People

Contributors

akoufa avatar albodelu avatar anstaendig avatar hitherejoe avatar jawnnypoo avatar ldhnam avatar makovkastar avatar meisolsson avatar ravidsrk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

clean-architecture-components-boilerplate's Issues

BrowseBufferoosViewModelFactory doesn't support multiple ViewModel subclasses

This is probably not a big deal right now since there's currently just one ViewModel subclass, but it's still worth noting...

Right now BrowseBufferoosViewModelFactory only supports one ViewModel subclass--BrowseBufferoosViewModel. If you define a second subclass of ViewModel, calling ViewModelProviders.of(this, viewModelFactory).get(SecondViewModel::class.java) will throw IllegalArgumentException: Unknown ViewModel class.

One way to address this is to have BrowseBufferoosViewModelFactory fetch a Provider<ViewModel> from the multibound map using modelClass as the key. Further details.

I can't build project

Im use Android Studio 3.0 Beta 7 and Kotlin 1.1.51

When I want to build project I getting an error

Error:Execution failed for task ':cache:kaptDebugKotlin'.
> Internal compiler error. See log for more details

Gradle Console


Configuration on demand is an incubating feature.
Configuration 'compile' in project ':mobile-ui' is deprecated. Use 'implementation' instead.
Configuration 'compile' in project ':presentation' is deprecated. Use 'implementation' instead.
'kapt.generateStubs' is not used by the 'kotlin-kapt' plugin
'kapt.generateStubs' is not used by the 'kotlin-kapt' plugin
'kapt.generateStubs' is not used by the 'kotlin-kapt' plugin
'kapt.generateStubs' is not used by the 'kotlin-kapt' plugin
:cache:preBuild UP-TO-DATE
:cache:preDebugBuild UP-TO-DATE
:cache:compileDebugAidl
:cache:compileDebugRenderscript
:cache:checkDebugManifest
:cache:generateDebugBuildConfig
:cache:generateDebugResValues
:cache:generateDebugResources
:cache:packageDebugResources
:cache:platformAttrExtractor
:cache:processDebugManifest
:cache:preDebugAndroidTestBuild UP-TO-DATE
:cache:compileDebugAndroidTestAidl
:cache:packageDebugRenderscript NO-SOURCE
:cache:processDebugAndroidTestManifest
:cache:compileDebugAndroidTestRenderscript
:cache:generateDebugAndroidTestBuildConfig
:cache:generateDebugAndroidTestResValues
:cache:generateDebugAndroidTestResources
:cache:mergeDebugAndroidTestResources
:cache:mockableAndroidJar
:mobile-ui:preBuild UP-TO-DATE
:presentation:preBuild UP-TO-DATE
:presentation:preDebugBuild UP-TO-DATE
:presentation:checkDebugManifest
:presentation:processDebugManifest
:mobile-ui:preDebugBuild
:presentation:compileDebugAidl
:mobile-ui:compileDebugAidl
:presentation:packageDebugRenderscript NO-SOURCE
:mobile-ui:compileDebugRenderscript
:mobile-ui:checkDebugManifest
:mobile-ui:generateDebugBuildConfig
:mobile-ui:generateDebugResValues
:mobile-ui:generateDebugResources
:presentation:compileDebugRenderscript
:presentation:generateDebugResValues
:presentation:generateDebugResources
:presentation:packageDebugResources
:mobile-ui:mergeDebugResources
:mobile-ui:createDebugCompatibleScreenManifests
:mobile-ui:processDebugManifest
:mobile-ui:splitsDiscoveryTaskDebug
:presentation:platformAttrExtractor
:cache:processDebugResources
:cache:generateDebugSources
:cache:processDebugAndroidTestResources
:cache:generateDebugAndroidTestSources
:mobile-ui:preDebugAndroidTestBuild
:mobile-ui:compileDebugAndroidTestAidl
:mobile-ui:processDebugAndroidTestManifest
:mobile-ui:compileDebugAndroidTestRenderscript
:mobile-ui:generateDebugAndroidTestBuildConfig
:mobile-ui:generateDebugAndroidTestResValues
:mobile-ui:generateDebugAndroidTestResources
:mobile-ui:mergeDebugAndroidTestResources
:mobile-ui:splitsDiscoveryTaskDebugAndroidTest
:mobile-ui:mockableAndroidJar
:presentation:generateDebugBuildConfig
:presentation:preDebugAndroidTestBuild UP-TO-DATE
:presentation:compileDebugAndroidTestAidl
:presentation:processDebugAndroidTestManifest
:presentation:compileDebugAndroidTestRenderscript
:presentation:generateDebugAndroidTestBuildConfig
:presentation:generateDebugAndroidTestResValues
:presentation:generateDebugAndroidTestResources
:presentation:mergeDebugAndroidTestResources
:presentation:mockableAndroidJar
:presentation:processDebugResources
:mobile-ui:processDebugResources
:mobile-ui:generateDebugSources
:mobile-ui:processDebugAndroidTestResources
:mobile-ui:generateDebugAndroidTestSources
:presentation:generateDebugSources
:presentation:processDebugAndroidTestResources
:presentation:generateDebugAndroidTestSources

BUİLD SUCCESSFUL in 9s
55 actionable tasks: 55 executed
Executing tasks: [:mobile-ui:assembleDebug]

Configuration 'compile' in project ':mobile-ui' is deprecated. Use 'implementation' instead.
Configuration 'compile' in project ':presentation' is deprecated. Use 'implementation' instead.
'kapt.generateStubs' is not used by the 'kotlin-kapt' plugin
'kapt.generateStubs' is not used by the 'kotlin-kapt' plugin
'kapt.generateStubs' is not used by the 'kotlin-kapt' plugin
'kapt.generateStubs' is not used by the 'kotlin-kapt' plugin
:cache:preBuild UP-TO-DATE
:cache:preDebugBuild UP-TO-DATE
:cache:compileDebugAidl UP-TO-DATE
:cache:compileDebugRenderscript UP-TO-DATE
:cache:checkDebugManifest UP-TO-DATE
:cache:generateDebugBuildConfig UP-TO-DATE
:cache:generateDebugResValues UP-TO-DATE
:cache:generateDebugResources UP-TO-DATE
:cache:packageDebugResources UP-TO-DATE
:cache:platformAttrExtractor UP-TO-DATE
:cache:processDebugManifest UP-TO-DATE
:cache:processDebugResources
:domain:compileKotlin
Using kotlin incremental compilation
:domain:compileJava NO-SOURCE
:domain:processResources NO-SOURCE
:domain:classes UP-TO-DATE
:domain:jar
:data:compileKotlin
Using kotlin incremental compilation
:data:compileJava NO-SOURCE
:data:processResources NO-SOURCE
:data:classes UP-TO-DATE
:data:jar
:cache:kaptGenerateStubsDebugKotlin
Using kotlin incremental compilation
:cache:kaptDebugKotlin
w: warning: Supported source version 'RELEASE_7' from annotation processor 'android.arch.persistence.room.RoomProcessor' less than -source '1.8'
w: 


e: C:\Proje\clean-architecture-components-boilerplate\cache\build\tmp\kapt3\stubs\debug\org\buffer\android\boilerplate\cache\model\CachedBufferoo.java:7: error: Cannot find getter for field.
e: 

e:     private long id;
e:                  ^

w: C:\Proje\clean-architecture-components-boilerplate\cache\build\tmp\kapt3\stubs\debug\org\buffer\android\boilerplate\cache\db\BufferoosDatabase.java:5: warning: Schema export directory is not provided to the annotation processor so we cannot export the schema. You can either provide `room.schemaLocation` annotation processor argument OR set exportSchema to false.
w: 

w: public abstract class BufferoosDatabase extends android.arch.persistence.room.RoomDatabase {
w:                 ^

e: java.lang.IllegalStateException: failed to analyze: org.jetbrains.kotlin.kapt3.diagnostic.KaptError: Error while annotation processing
	at org.jetbrains.kotlin.analyzer.AnalysisResult.throwIfError(AnalysisResult.kt:57)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules(KotlinToJVMBytecodeCompiler.kt:138)
	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:170)
	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:58)
	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:93)
	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:46)
	at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:92)
	at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$1$2.invoke(CompileServiceImpl.kt:386)
	at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$1$2.invoke(CompileServiceImpl.kt:98)
	at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:832)
	at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:98)
	at org.jetbrains.kotlin.daemon.common.DummyProfiler.withMeasure(PerfUtils.kt:137)
	at org.jetbrains.kotlin.daemon.CompileServiceImpl.checkedCompile(CompileServiceImpl.kt:859)
	at org.jetbrains.kotlin.daemon.CompileServiceImpl.doCompile(CompileServiceImpl.kt:831)
	at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:385)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:346)
	at sun.rmi.transport.Transport$1.run(Transport.java:200)
	at sun.rmi.transport.Transport$1.run(Transport.java:197)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: org.jetbrains.kotlin.kapt3.diagnostic.KaptError: Error while annotation processing
	at org.jetbrains.kotlin.kapt3.AnnotationProcessingKt.doAnnotationProcessing(annotationProcessing.kt:90)
	at org.jetbrains.kotlin.kapt3.AnnotationProcessingKt.doAnnotationProcessing$default(annotationProcessing.kt:42)
	at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.runAnnotationProcessing(Kapt3Extension.kt:205)
	at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.analysisCompleted(Kapt3Extension.kt:166)
	at org.jetbrains.kotlin.kapt3.ClasspathBasedKapt3Extension.analysisCompleted(Kapt3Extension.kt:82)
	at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM$analyzeFilesWithJavaIntegration$2.invoke(TopDownAnalyzerFacadeForJVM.kt:96)
	at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:106)
	at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$default(TopDownAnalyzerFacadeForJVM.kt:83)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:377)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:68)
	at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:96)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:368)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules(KotlinToJVMBytecodeCompiler.kt:133)
	... 30 more


:cache:kaptDebugKotlin FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':cache:kaptDebugKotlin'.
> Internal compiler error. See log for more details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUİLD FAILED in 9s

15 actionable tasks: 7 executed, 8 up-to-date

Indirect dependencies

Hello @hitherejoe ,

I have a question about dependencies. Currently, Remote module depends on Data, and Data module depends on Domain and because of that If we want to get information from Remote with Models that actually should be only in Remote we have to create a duplication of that model at each layer.

Example:
We have Remote module for the API that has method getRepositoryByPlatform(platform: Platform)
and our Platform is simple Enum class enum class Platform { IOS, ANDROID }
without duplication Platform class would be in Domain layer. But in this case if we need to specify @SerializedName for example, we would need to add Gson dependency to Domain layer, that looks incorrect from my point of view. And because of that creating Platform representation model at each layer looks like an overhead to me.

So the question is how do you handle such cases?

CompositeDisposable dispose vs clear in FlowableUseCase

Have adapted some of this code for my own project and one issue I ran in to was around use of CompositeDisposable.dispose() in FlowableUseCase for case where I need to update the subscription. In my case at least switching to clear resolved the issue. It looks like calling dispose has effect of not allowing subsequent use of disposables.

Android Studio 3.2 Canary 14 Doesn't find any tests

Import the project into the latest canary for 3.2. You have to update a few dependencies like the android plugin and references to compile in the gradle files. compile needs to be changed to implementation.

Once it's complete, go into any subproject and try to run the tests by right-click the root package and select Run Tests in .... You will see the output below:

0 test classes found in package '<default package>'

Process finished with exit code 254
Empty test suite.

saveBufferoos is called even when data is retrieved from cache

In the following code saveBufferoos is called even when data is retrieved from cache (db)....for relatively large amounts of data this can be pretty time consuming.

    override fun getBufferoos(): Flowable<List<Bufferoo>> {
        return factory.retrieveCacheDataStore().isCached()
                .flatMapPublisher {
                    factory.retrieveDataStore(it).getBufferoos()
                }
                .flatMap {
                    Flowable.just(it.map { bufferooMapper.mapFromEntity(it) })
                }
                .flatMap {
                    saveBufferoos(it).toSingle { it }.toFlowable()
                }
    }

How to implement onClick for RecyclerView?

What part of the application would need to implement onClick for users to be able to click on an item in the RecyclerView and navigate to a fragment/activity for the single model? Would you put it in the presentation layer or the mobile ui layer?

Java 1.7 support

The requirements state Java 1.8, which requires anrdoid api 24.
If this project truly requires 1.8, then will it not work on all api's below 24 which run java 1.7?

Why is BufferooEntity in the data layer?

I could be wrong here but I thought the domain layer should not be aware of anything in the data layer, and I that the "entities" are actually at the lowest layer inside the domain layer.

So from my understanding the domain layer can have access to the entities but it should not know anything about the data layer version of an entity. So I'm confused as to why the BufferooEntity is at the data layer instead of the domain layer. Is it a naming mistake or am I not understanding something? As far as I can tell the names are the wrong way around and it's the Bufferoo that should be at the data layer and the BufferooEntity should be at the domain layer. Aside from the name they are identical.

BrowseBufferoosViewModel doesn't survive configuration change

Steps to repro:

  1. Set a breakpoint or log in BrowseBufferoosViewModel.init
  2. Build & deploy
  3. Rotate device
  4. Observe that the log or breakpoint in BrowseBufferoosViewModel.init is hit for every rotation

android.arch.lifecycle.ViewModels are meant to survive config changes.

BrowseBufferoosViewModel will survive config changes if it's retrieved in BrowseActivity the normal way using ViewModelProviders.of. If you prefer to inject with dagger, take a look at this sample, then retrieve the ViewModel like so

@PerActivty scope

First off, thanks for all the great work that went into this repo.

I just wanted some clarification with the purpose of @PerActivity. To explain further, after a configuration change the BrowseBufferoosViewModel instance returned by the framework will be the same one (same memory location) as before the config change happened (i.e. the instance is retained across configuration changes). This is one of the benefits of using the new ViewModel Architecture Component. It may be desired for other objects that are not tied to the Android framework to have this same behavior (i.e. an object that prevents the user to move to another screen if a network request is ongoing while a config change is happening). Dagger can be leveraged to achieve this by using scoping. Is this what you are trying to achieve with @PerActivity or are you just indicating that the module is providing Activity specific dependencies?

P.S. I realize that if we want an object to be retained across config changes, we can make it a dependency of the ViewModel in question, but this may lead to overly complicated constructors.

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.