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
KotlinでRealmを扱う
Search
Takahiro Hiasa
May 30, 2018
Programming
1
1.2k
KotlinでRealmを扱う
Takahiro Hiasa
May 30, 2018
Tweet
Share
More Decks by Takahiro Hiasa
See All by Takahiro Hiasa
EMとしての醍醐味
takahia1988
0
93
日浅流、 エンジニアリングマネージャーのしごと
takahia1988
0
610
1つのアプリを開発する複数の職能横断チームの運用と今後 ~ タクシーアプリ「GO」の現状と未来 ~
takahia1988
1
8.4k
初めてのDroidKaigiプラチナスポンサー 〜エンジニアと作るスポンサー企画〜
takahia1988
0
260
どうする?GOする!LeSS導入する!?
takahia1988
0
4.9k
JapanTaxi × MOV = GOの開発体制とiOS14対応
takahia1988
0
1.3k
社内環境で紐解くfastlane match
takahia1988
0
800
Application Coordinatorを利用した画面遷移
takahia1988
0
1.5k
Other Decks in Programming
See All in Programming
VitestのIn-Source Testingが便利
taro28
8
2.4k
Dissecting and Reconstructing Ruby Syntactic Structures
ydah
3
2.1k
Global Azure 2025 @ Kansai / Hyperlight
kosmosebi
0
140
REALITY コマンド作成チュートリアル
nishiuriraku
0
120
Laravel × Clean Architecture
bumptakayuki
PRO
0
150
Enterprise Web App. Development (1): Build Tool Training Ver. 5
knakagawa
1
120
マイコンでもRustのtestがしたい/KernelVM Kansai 11
tnishinaga
0
830
AIコーディングの理想と現実
tomohisa
36
38k
AWS Summit Hong Kong 2025: Reinventing Programming - How AI Transforms Our Enterprise Coding Approach
dwchiang
0
130
Ruby on Railroad: The Power of Visualizing CFG
ydah
0
300
MySQL初心者が311個のカラムにNot NULL制約を追加していってALTER TABLEについて学んだ話
hatsu38
2
110
データと事例で振り返るDevin導入の"リアル" / The Realities of Devin Reflected in Data and Case Studies
rkaga
1
460
Featured
See All Featured
Code Reviewing Like a Champion
maltzj
523
40k
Reflections from 52 weeks, 52 projects
jeffersonlam
349
20k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
13
840
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
5
560
YesSQL, Process and Tooling at Scale
rocio
172
14k
GraphQLの誤解/rethinking-graphql
sonatard
71
10k
Embracing the Ebb and Flow
colly
85
4.7k
Navigating Team Friction
lara
185
15k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.4k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
331
21k
Transcript
KotlinでRealmを扱う Takahiro Hiasa @takahia 2018/05/30 集まれKotlin好き!Kotlin愛好会 vol1
⾃⼰紹介 ´ iOS, Server Side Java, Server Side Python ´
最近PrivateでAndroidをKotlinで開発してます! ´ Kotlinとの出会いは、 Spring Boot → Spring 5 RC → core libの⼀部がKotlinに置き換わ る → 勝⼿に社内APIをSpring Boot + KotlinでAPIを作ってみた ´ Kotlinはまだまだ初⼼者です
今⽇はAndroidでKotlinでRealmを扱った 話をします
Realmを扱う(example 1)
Realmを扱う(example 2)
なんて⾯倒くさいんだろう Transaction管理 CRUDの実装 毎回
Spring Boot(Server Side)でDBを扱う
そう、Spring Bootは ´ annotation1個でTransaction管理ができる ´ 共通のinterfaceで基本的なCRUDを実装できる
Motivation AndroidでRealmを簡単に実装したい
通常のTransaction管理
Kotlinっぽくinline関数で定義 ´ I/FはJavaEEの@Transactionalを参考
基本的なCRUDの実装を abstract classでBaseDaoを定義
BaseDaoを継承した DogDaoとPersonDaoを定義
Realmを扱う スッキリした!!
Spring Bootと⽐較すると Spring Boot Realm
まとめ ´ RealmのTransaction管理はinlineで定義して しまって共通化する ´ Realmの基本的なCRUDはabstract classで定 義してしまって共通化する
None