Skip to content

implement Dagger.#18

Open
Shayan-Sakhaei wants to merge 3 commits intodevfrom
shayan/Dagger
Open

implement Dagger.#18
Shayan-Sakhaei wants to merge 3 commits intodevfrom
shayan/Dagger

Conversation

@Shayan-Sakhaei
Copy link
Collaborator

No description provided.

Copy link
Owner

@helloseyedjafari helloseyedjafari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job
keep it up

kapt(DaggerLibs.daggerCompiler)

implementation (Utils.exoplayer)
implementation(GsonLibs.gson)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gson abzare khobi nist
lotfan az moshi estefade konid

interface AppComponent {


fun provideWebService(): WebService
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chera bayad service to scope application provide beshe?


@JvmStatic
@Provides
fun provideWebService(retrofit: Retrofit): WebService {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

har feature i mitone/behtare service e khodesho dashte bashe
pas niazi be inja dashtanesh nist

return Retrofit.Builder()
//TODO insert Base URL here.
.baseUrl("")
.addConverterFactory(GsonConverterFactory.create(gson))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moshi

): OkHttpClient {
return OkHttpClient.Builder()
.addInterceptor(httpLoggingInterceptor)
.cache(cache)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

toye debug va test cache nadashte bashim fek konam rahat tarim ke
kamtar ro mokh bere


@Scope
@Retention(AnnotationRetention.RUNTIME)
annotation class MainActivityScope No newline at end of file
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mitonim scope ro generic konim va ye scope baraye hameye Screen ha dashte bashim masalan:
ScreenScope

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

با توجه به صحبت هایی که شد سر استفاده نکردن از اون اسکوپ جنریک،من منظورتو اینجا متوجه نمیشم،این جنریک ی که اینجا میگی و تو ذهنته چیه؟!
مورد بعدی اینکه اگر یه اسکرین وابستگی های متفاوتی از بقیه اسکرین ها داشته باشه اونوقت اسکوپ جدا میخواد و این اسکوپ کاربردی نداره،پس...؟

}

object DaggerLibs{
object GsonLibs {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

benazaram Gson niazi nist

}
}

// @JvmStatic
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment nadashte bashim fek konam code base tamiz tar khahad bod

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

این به این منظور کامنت شده که بچه ها بعدا بتونن بر اساس نیاز ازش استفاده کنن یا اصلا بخوننش و هرجور میخوان تغییرش بدن.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clean code mige code comment shode yejash milange!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

یعنی CleanCode تمام حالات و اتفاقات رو ازش باخبر بوده و در نظر گرفته؟
مسلما نه، مورد بعدی اینکه: من میفهمم ذات کد کامنت مشکل داره و استدلال CleanCode دراین رابطه رو هم میدونم اما ما با یه پروژه آموزشی سر و کار داریم نه پروداکشن حداقل تا این لحظه.


@Scope
@Retention(AnnotationRetention.RUNTIME)
annotation class ScopeIn(val value: KClass<*>) No newline at end of file
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in aslan tosie nemishe va piade sazie khobi nist
dar zemn besorate default @Named("") ro darim ke onam hamin ghad bade
va say mishe azash dori beshe

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

لطفا دلایل بد بودنش رو بگید که همگی با منطق و دلیل بدونیم چرا نباید ازش استفاده کرد،اینجوری هم سوادمون بیشتر میشه هم خیلی بهتر تو ذهنمون میمونه که ازش دوری کنیم.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh kheili sakhte bazi chiza dalil avordan!
kholasash:
shoma bayad baraye scope haye mokhtale Scope jadid besazi va ono modiriat koni
in scope jadid sakhtane khanayi ro bala mibare va kheili vazeh hamechiz ro bayan mikone
vali hich kodom az ina ba pass dadane yek parameter ghabele hal nist!
baadesham in scope ye class e dige be onvane vorodi migire ke khob onvaght on class mishe scope khob che karie? chera ye scope jadid nasazim be jaye ye scope parameter e jadid??
dar zemn ye mozo i has be name in ke :
chizi ke mishe ye type bashe ro dakhele esm gharar nadim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants