Upgrade to Pro — share decks privately, control downloads, hide ads and more …

あるあるLT_Android採用編_20191224.pdf

RyoWATANABE
December 24, 2019
500

 あるあるLT_Android採用編_20191224.pdf

RyoWATANABE

December 24, 2019
Tweet

Transcript

  1. 自己紹介 ๏ なべ@nabetaro_jp ๏ and factory.inc ๏ Android エンジニア ๏

    漫画アプリ開発 #スクラム #採用 #チームビルディング #iOSビギナー
  2. 例:bundleOf class TitleFragment : Fragment() { companion object { fun

    newInstance(titleId: TitleId) = TitleFragment().apply { arguments = bundleOf(KEY_TITLE_ID to titleId) } } }
  3. 例:bundleOf class TitleFragment : Fragment() { companion object { fun

    newInstance(titleId: TitleId) = TitleFragment().apply { arguments = bundleOf(KEY_TITLE_ID to titleId) } } }
  4. viewModelScope fun fetchData(titleId: TitleId) { viewModelScope.launch { _uiState.postValue(UiState.Loading) when (val

    result = fetchTitleUseCase.execute(titleId)) { is Result.Success -> { _uiState.postValue(UiState.Loaded) _data.postValue(result.data) } is Result.Failure -> { when (val e = result.error) { is TopError.NetworkError -> _uiState.postValue(UiState.Retry) is TopError.TopClientError -> { _uiState.postValue(UiState.Error) showPopupAction.postValue(Event(e.popup)) } else -> showErrorCommand.postValue(e) } } } } }
  5. viewModelScope fun fetchData(titleId: TitleId) { viewModelScope.launch { _uiState.postValue(UiState.Loading) when (val

    result = fetchTitleUseCase.execute(titleId)) { is Result.Success -> { _uiState.postValue(UiState.Loaded) _data.postValue(result.data) } is Result.Failure -> { when (val e = result.error) { is TopError.NetworkError -> _uiState.postValue(UiState.Retry) is TopError.TopClientError -> { _uiState.postValue(UiState.Error) showPopupAction.postValue(Event(e.popup)) } else -> showErrorCommand.postValue(e) } } } } }
  6. viewModelScope fun fetchData(titleId: TitleId) { _titleId = titleId viewModelScope.launch {

    _uiState.postValue(UiState.Loading) when (val result = fetchTitleUseCase.execute(titleId)) { is Result.Success -> { _uiState.postValue(UiState.Loaded) _data.postValue(result.data) } is Result.Failure -> { when (val e = result.error) { is TopError.NetworkError -> _uiState.postValue(UiState.Retry) is TopError.TopClientError -> { _uiState.postValue(UiState.Error) showPopupAction.postValue(Event(e.popup)) } else -> showErrorCommand.postValue(e) } } } } } ๏ ViewModelScopeでJob のキャンセルをVMのライフサ イクルに紐づけることで非同 期処理の管理が楽に
  7. だいじなところは何なのか ๏ Android アプリ設計パターン入門 ๏ Fat Activity問題 : 複雑性の増加による開発速度の低下 ๏

    Dagger2 : DIライブラリ。Annotationによるコンパイル時のコード生成ベー ス。クラス間の結合度を低下させるため、アジャイル開発やテストに強い。 ๏ RxJava2 : リアクティブプログラミング用。コールバック地獄対策。非同期 処理の実装だけだと学習コストが高いのでCoroutineを使うことが増えた。 ๏ 実際の開発現場のハナシ
  8. Retrofit + OkHttpは すでにデファクトスタンダード ๏ AsyncTaskを覚えているだろうか?2012年くらいでしょうか・・ ๏ AsyncTaskが抱えていた問題 https:// www.techyourchance.com/asynctask-deprecated/

    ๏ Square製 ๏ 今年の6月Version 2.6.0(最新は2.7.0)でサスペンド修飾子がサ ポートされ、HTTPリクエストをcoroutineを使ってかけるようになった @GET("users/{id}") suspend fun user(@Path("id") id: Long): User https://www.techyourchance.com/asynctask-deprecated/
  9. Retrofit + OkHttpは すでにデファクトスタンダード ๏ AsyncTaskを覚えているだろうか?2012年くらいでしょうか・・ ๏ Square製 ๏ 今年の6月Version

    2.6.0(最新は2.7.0)でサスペンド修飾子がサ ポートされ、HTTPリクエストをcoroutineを使ってかけるようになった @GET("users/{id}") suspend fun user(@Path("id") id: Long): User Retrofitてかいてますやん
  10. ? 大事なのは「なぜ」 ๏ What < How < Whyの順番で答えるのは難しくなる ๏ なぜこの技術を使うことになったのか、経緯を知りたい

    ๏ 何を解決するものなのか、この技術が大事にしていることはなんなのか チームメンバーと開発する上で、納得感を持って作業するためにはなぜに 向き合う必要がある