Giter Club home page Giter Club logo

ios_architecture_samplecode's Issues

コーディングルール

決めていくと良さそうなこと書き残していきます

インタフェースと具体型のネーミング

_ インタフェース 具体型
パターン1 Hoge HogeImpl
パターン2 HogeProtocol Hoge
パターン3 Hoge ○○Hoge

参考:
業務系のクラスでインタフェイスの実装クラス名に「インタフェイス名+Impl」って名前をつけるのはダサいよね。 - wildcatsの日記
http://d.hatena.ne.jp/wildcats/20061203/1165135539

GitHubのリポジトリ の呼び方

論点:

  • 各章のコードでバラバラ
  • 8章でデータ層としてのexternal interfaceをRepositoryと言いたいけどそれだと名前空間がかぶる

https://peaks-cc.slack.com/archives/G9E5DDLFM/p1537162141000100?thread_ts=1537155417.000100&cid=G9E5DDLFM

  • リポジトリ(名前難しい)には検索したGitHubリポジトリに対しUIで付けるスターの状態(+GitHubリポジトリの内容)を保存するので、GitHubリポジトリリポジ…むむう

Result

他にも各サンプルコードを横断しながら見て気付いたら追記します

本と章がずれている

本では 8 章が Flux の章になっていますがサンプルコードは 08 ディレクトリが Clean Architecture になっており 09 ディレクトリが Flux になっています。それ以降の章も本とサンプルコードのディレクトリがずれているようです。

RepositoryのPresenter内での完全な隠蔽

https://github.com/peaks-cc/iOS_architecture_samplecode/blob/master/06/MVPSample/MVPSample/Presenter/RepositoryListPresenter.swift#L20

https://peaks-cc.slack.com/archives/G9E5DDLFM/p1537166975000100?thread_ts=1537163915.000100&cid=G9E5DDLFM

@Danbo-Tanaka
https://github.com/peaks-cc/iOS_architecture_samplecode/blob/master/06/MVPSample/MVPSample/Presenter/RepositoryListPresenter.swift#L20
同じファイルで気になってときがあるので、こちらに投稿させていただきますm(_ _)m

`var numberOfRepositories: Int` で隠蔽するのであれば、 `func repository(at index: Int) -> Repository` にしてしまって、  `var repositories: [Repository]` 自体もP内で完結するようにしてしまった方が良さそうです。

14章のサンプルがビルドできない

14 章の FluxWithRxSwift, FluxPlusExample をビルドするためまず RxSwift をインストールしようとすると

$ carthage update
*** Fetching iOS_architecture_samplecode
Parse error: expected submodule commit SHA in output of task (ls-tree -z HEAD 15/FluxPlusExample/Carthage/Checkouts/iOS_architecture_samplecode) but encountered: 

となってインストールできません。

環境は
git 2.20.1
carthage 0.32.0
です。

DIPのためのインタフェース化


private weak var repositoryListViewController: RepositoryListViewController!

takasek:
VCは具体型じゃなくてprotocolとして持とう!

ktanaka117:
DIPの説明を入れるかどうかに寄るので、ちょっと考えていた部分でした。
テストについて触れるなら必須なのですが:thinking_face:

takasek:
やっといて損はない(各章で矛盾が生まれない)とこかなーとは思いましたが、まあ今はそれより初稿なので一旦議論は置きですね!

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.