我正在尝试使用Dagger 2(使用Android模块)向我的存储库提供一个Retrofit实例.买我面临错误:
错误:无法访问Retrofit
像毕加索这样的其他实例注入成功,我只是在改造时遇到了问题.
我的模块
@Module
class NetworkModule {
@Provides
@Singleton
fun providesRetrofit(): Retrofit {
return Retrofit.Builder()
.addConverterFactory(GsonConverterFactory.create())
.baseUrl(URL_BASE)
.build()
}
@Provides
@Singleton
fun providesPicasso(context: Context): Picasso {
return Picasso.Builder(context)
.loggingEnabled(true)
.build()
}
@Provides
@Singleton
fun providesRemoteRepository(retrofit: Retrofit): RemoteRepository = RemoteRepository(retrofit)
@Provides
@Singleton
fun providesRepository(remote: RemoteRepository): Repository = RepositoryImp(remote)
}
Run Code Online (Sandbox Code Playgroud)
我的应用程序组件
@Singleton
@Component(modules = arrayOf(
AppModule::class, NetworkModule::class, AndroidInjectionModule::class, ActivityBuilder::class
))
interface AppComponent {
@Component.Builder
interface Builder {
@BindsInstance
fun application(app: Application): Builder
fun build(): AppComponent
}
fun inject(application: AppApplication)
} …Run Code Online (Sandbox Code Playgroud) 下午好,
我正在大学开发我的serach Hibernate和JDBC之间的比较,这项工作的主要重点是性能.
我被指控的一个问题与我将如何进行这些性能测试有关.
嗯,这是我的工作简要,拥有两个方法,对数据库进行查询以寻求数据X,这些查询将在hibernate和jdbc中编写,并从中进行测试.
你能告诉我这些测试的执行频率和评估方式吗?使用了什么工具?搜索我找到了一个名为JConsole的jdk附带的工具,你认为这个工具可以解决我的问题吗?
谢谢:]