$30 off During Our Annual Pro Sale. View Details »

パッケージ構成っていつでも悩ましい

Avatar for Keigo Suda Keigo Suda
November 05, 2017
0

 パッケージ構成っていつでも悩ましい

Avatar for Keigo Suda

Keigo Suda

November 05, 2017
Tweet

Transcript

  1. パッケージを決めるための考慮ポイント l ⾒通しの良さ l 機能配置の視認性(どこに何があるか分かる,サイクルインポートさせない作り, ・・・) l テストのやりやすさ(テスト実⾏の単位, ・・・) l

    再利⽤のしやすさ l 独⽴して利⽤できる機能 l internalパッケージの利⽤ l 詳細の隠蔽 l パッケージ間の連携はインタフェースで l あげればきりがない・・・
  2. ちまたの流儀? l Golang Package Composition for Web Application: The Case

    of Mercari Kauru l https://speakerdeck.com/mercari/ja-golang-package-composition-for-web- application-the-case-of-mercari-kauru l Standard Package Layout l https://medium.com/@benbjohnson/standard-package-layout-7cdbc8391fc1 l Go and a Package Focused Design l https://medium.com/@benbjohnson/standard-package-layout-7cdbc8391fc1
  3. 例)センサデータ受け付けるAPIサーバ l ~5⼈(Go経験1⼈/Java経験4⼈)ほどで開発した際のパッケージ構成 l Javaユーザへの導⼊としては意外とはまる(Goらしいかというと、、、) ・ ┗━━ data-uploader ┣━━ main.go

    ┣━━ api ┃ ┣━━handler.go ┃ ┗━━route.go ┣━━ controller ┃ ┣━━event.go ┃ ┗━━sensor.go ┣━━ service ←作らない時もある ┃ ┣━━ topic_routing.go ┃ ┗━━ ・・・ ┣━━ model ┃ ┣━━event.go ┃ ┗━━sensor.go ┗━━ util ┣━━ xxxutil ┃ ┗━━ ・・・ ┗━━ ・・・ https://www.slideshare.net/keigosuda/iot-72733494 ココのところ
  4. ほんとすいません🙇🙇🙇🙇🙇🙇🙇🙇🙇 Golang UK Conference 2016 - Building an enterprise service

    in Go GoPhoerCon 2017 - Go Anti-Patterns l よく使われているのには理由がある? l これぐらいのよくあるネーミングの⽅が未経験ユーザへの導⼊はしやすい?