Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Atomic Design周りについての私見
Search
ponday
November 29, 2018
Programming
820
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Atomic Design周りについての私見
ITのむずかしいを簡単にする会 - LT会 #5(2018/11/29)の発表資料です。
ponday
November 29, 2018
More Decks by ponday
See All by ponday
関数型でGoFのデザインパターンやってみる
honda
1
1.7k
TypeScriptの型表現
honda
10
3.2k
Web Componentsの今
honda
1
480
これまでのReact、これからのReact
honda
0
350
Gatsbyお試し
honda
0
150
styled-components or emotion?
honda
0
730
Web ComponentsとAngular
honda
0
160
え、まだWeb Componentsを未来の技術だと思ってるの?
honda
2
890
Web Componentsの動向とPolymer
honda
4
2.8k
Other Decks in Programming
See All in Programming
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
250
難しいけど、読めた。- OSSの入口に立った話。
sts11142
0
130
Security issues being discussed on Web Platforms
petamoriken
0
1.4k
JRuby: Past, Present, and Future
headius
0
210
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
海上で動くGoサーバー: goroutineとchannelでさばく航行データストリーム
atsuki_seo
0
1k
仕様駆動開発による爆速プロダクト開発 / Bakusoku Spec Driven Development
kobakei
0
150
AGENTS.md Is Not Enough:Build Skills, Don't Download Them
lx_t
0
130
MVNOの申込からeSIM開通までをiOSアプリでつなぐ- 本人確認・MNP・通信事業者基盤をまたぐ実装
satotakeshi
0
510
Intent as Code
shoppingjaws
6
1.1k
Turning Architecture into Unit Tests in the AI Era (NSSpain XIV)
steliosf
PRO
1
120
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
30
13k
Featured
See All Featured
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
850
A Soul's Torment
seathinner
8
3.7k
Building the Perfect Custom Keyboard
takai
2
890
Navigating Weather and Climate Data
rabernat
0
540
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.1k
Product Roadmaps are Hard
iamctodd
55
13k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Claude Code のすすめ
schroneko
67
230k
Everyday Curiosity
cassininazir
0
330
Build your cross-platform service in a week with App Engine
jlugia
234
19k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
For a Future-Friendly Web
brad_frost
183
10k
Transcript
Atomic Design周りについての私見 ITのむずかしいを簡単にする会 - LT会 #5 / Nov 29th, 2018
ponday (@ponday_dev)
Profile - ponday (Honda, Yusuke) - 株式会社ベガコーポレーション エンジニア - Like
: TypeScript / Elixir / Python etc… - 日曜フロントエンドエンジニア - 副業もやってます
#think_atomic_design
Atomic Design ? - UIデザイン手法の一つ - コンポーネントを原子、分子に見立てる - ページ単位ではなく、コンポーネント単位で考える -
小さいコンポーネントの組み合わせでページを表現
None
詳しくは Webで
理屈はかんたん
しかし、実際に適用してみると......
このコンポーネントは Atoms? Molecules? CSSってどう分けるべき? コード量が増えてつらい...... 状態はどこでどう管理すれば良いんだろう?
どうもやりづらい......
なぜ?
Atomic Design ≠ アプリケーションの 設計手法
Atomic Design = UIデザインの手法
Atomic Design がもたらしたもの - コンポーネント指向ベースのデザインシステム - ページ → 部品ではなく部品 →
ページな考え方 - エンジニアとデザイナの共通言語 - ページを構成するコンポーネント階層の体系付け - 階層ごとの命名
Atomic Design が考慮しないもの - CSS設計 - ロジックを分割する境界 - デザイン的な境界とプログラム的な境界は違うはず -
データの受け渡し - コンポーネントのプロパティ - 状態管理
アプリケーション開発に適用するには +α が必要
+αで検討が必要なもの - コンポーネントの管理 - コンポーネント間の依存関係 - コンポーネント間のデータの受け渡し - 状態管理
※ ここからは完全に個人的見解
基本戦略
コンポーネントの役割 Atoms Molecules Organisms Templates 役割 汎用的な部品 汎用的な部品 アプリケーション固有の部品 ページのレイアウトなど
基本戦略 - Atoms、Moleculesは汎用的にする - 他プロジェクトでの再利用性も考慮 - 依存関係をシンプルに保つ - UIライブラリとして提供するのはこのあたりまで -
Organisms以上はそのアプリケーション固有の層 - 基本的にそのアプリケーションの外では再利用しない
TemplatesとPages - PagesはTemplatesに具体的なデータが入ったもの - つまりPages = 最終的なレンダリング結果 - コンポーネントはTemplatesまで作れば良い -
UIテスト用にPagesを定義するという手も
コンポーネントの管理
コンポーネントの管理 - そのままではコンポーネントの重複は免れない - Storybookなどの導入は事実上必須
コンポーネント間の依存関係
厳密に言えば、あるコンポーネントは 一つ下レイヤーのコンポーネントのみに依存する
ただし現実的には、この制約は結構つらい
コンポーネント間の依存関係 Atoms Molecules Organisms Templates 依存するもの なし Atoms Atoms Molecules
Organisms Organisms 依存の数 0 2つ以上 1つ以上 1つ以上
コンポーネント間の依存関係 Atoms Molecules Organisms Templates 依存するもの なし Atoms Atoms Molecules
Organisms Organisms 依存の数 0 2つ以上 1つ以上 1つ以上 ここは無理に 制限しない
データの受け渡し
Organisms Molecules Atoms Templates props props props event event event
『プロパティを渡して、イベントを受け取る』が原則
データの受け渡し - 親→子はプロパティ - 親は自分が受け取ったプロパティを、子に適切に振り分ける - Templates→Atomsでプロパティのサイズは小さくなるはず - 子→親はイベントハンドリング -
状態管理まわりなど、一部例外あり(後述)
状態管理
Organisms Molecules Atoms Templates props props props event event event
Store subscribe / dispatch (subscribe) /dispatch
Organisms Molecules Atoms Templates props props props event event event
Store subscribe / dispatch ここは汎用的に保ちたい → Storeにはアクセスしない (subscribe) /dispatch
Organisms Molecules Atoms Templates props props props event event event
Store (subscribe) /dispatch subscribe / dispatch アプリケーション固有のロジックは Templates、Organismsで処理 → Storeもアプリケーション固有
状態管理 Atoms Molecules Organisms Templates dispatch - - ◦ ◦
subscribe - - △ ◦
状態管理 Atoms Molecules Organisms Templates dispatch - - ◦ ◦
subscribe - - △ ◦ ※このあたりはプロジェクトの特性による
まとめ - Atomic DesignはあくまでUIデザインの手法 - そのままアプリケーション開発に使うとつらい - 制約が強い - そもそもプログラムとしての実装が考慮されていない
- アプリケーション開発のためには+αの設計が必要 - 考えないといけないことは結構多い
アプリケーション開発も考慮に入れた Alt Atomic Designの登場を待つのも手では?
Thank you !!