Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
†黒魔術† と Annotation と AspectJ
Search
kaiinui
August 23, 2014
Technology
3
1.2k
†黒魔術† と Annotation と AspectJ
Annotation と AspectJ で楽しい黒魔術 (▰╹◡╹▰)
kaiinui
August 23, 2014
Tweet
Share
More Decks by kaiinui
See All by kaiinui
Black Magic in Java
kaiinui
1
600
API開発自動化と量産
kaiinui
1
460
Other Decks in Technology
See All in Technology
Physical AI on AWS リファレンスアーキテクチャ / Physical AI on AWS Reference Architecture
aws_shota
1
130
Blue/Green Deployment を用いた PostgreSQL のメジャーバージョンアップ
kkato1
0
130
「お金で解決」が全てではない!大規模WebアプリのCI高速化 #phperkaigi
stefafafan
5
2.3k
Laravelで学ぶOAuthとOpenID Connectの基礎と実装
kyoshidaxx
4
1.8k
Phase06_ClaudeCode実践
overflowinc
0
2k
非同期・イベント駆動処理の分散トレーシングの繋げ方
ichikawaken
1
110
【社内勉強会】新年度からコーディングエージェントを使いこなす - 構造と制約で引き出すClaude Codeの実践知
nwiizo
24
12k
Agent Skill 是什麼?對軟體產業帶來的變化
appleboy
0
230
A4)シラバスを超えて語る、テストマネジメント
moritamasami
0
130
Copilot 宇宙へ 〜生成AIで「専門データの壁」を壊す方法〜
nakasho
0
190
契約書からの情報抽出を行うLLMのスループットを、バッチ処理を用いて最大40%改善した話
sansantech
PRO
2
260
スケールアップ企業でQA組織が機能し続けるための組織設計と仕組み〜ボトムアップとトップダウンを両輪としたアプローチ〜
qa
0
280
Featured
See All Featured
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.2k
How STYLIGHT went responsive
nonsquared
100
6k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
480
RailsConf 2023
tenderlove
30
1.4k
The agentic SEO stack - context over prompts
schlessera
0
710
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
130
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
280
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.4k
From π to Pie charts
rasagy
0
160
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.5k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
290
Transcript
†黒魔術† @_kaiinui
=
結論から? (▰╹◡╹▰)
@PotatoTip をつけるだけでトースト
Java の黒魔術: Annotation
Java の黒魔術: Annotation どうみても黒魔術
Java の黒魔術: Annotation Annotation as a code?
良さ? ・宣言的さ ・コードと「宣言」を分離出来る ・コードが短くなったり ・ミスを防止したり(@Nullable)
・ButterKnife の @InjectView ・Support Annotation の @NonNull ・AndroidAnnotations の @UiThread
・Rails の has_many 「する」と「である」を分ける
良い例: ButterKnife の @InjectView
する textView = (TextView) findViewById(R.id.text); である @InjectView(R.id.text) textView;
する runOnUiThread(new Runnable {...}); である @UiThread public void showToast() {..};
さて
Bring your own Annotation!
ツール • AspectJ • java.lang.annotation
初級編 Annotation を普通に使う(AspectJ じゃない)
1. Annotation をつくる(カンタン)
2. 黒魔術
3. 出来た
4. 完成 BananaKnife
中級編 AspectJ でアスペクトを織り込む
1. Annotation をつくる(カンタン)
2. AspectJ で黒魔術
@PotatoTip をつけるだけでトースト
AspectJ の良い例: Hugo
AspectJ の良い例: Hugo あまりに便利なので iOS 版もつくった kaiinui/KILogInjector
一言で? ・Annotation で @Hoge がついたメソッド、フィー ルド、クラスとかを弄れたりする ・AspectJ で処理をフックしてほげほげ、といった 処理がカンタンに書ける。 (▰╹◡╹▰)
きみだけのさいきょう @Annotation をつくろう!
「モデルと API 辛い」周りの話がしたかった あと自分で作るとかどうでもいいので既にある Annotation をまず使おう (▰╹◡╹▰) 最後に