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
ORMの選び方(Android編)
Search
FUJI Goro
March 16, 2016
Technology
2
3.8k
ORMの選び方(Android編)
#potatotips 27 (2016/03/16) の資料です
FUJI Goro
March 16, 2016
Tweet
Share
More Decks by FUJI Goro
See All by FUJI Goro
How to Boost Your Code with WebAssembly
gfx
2
2.8k
AssemblyScriptでライブラリコードの高速化をしてみる
gfx
5
2.9k
実践TypeScriptトークバトル
gfx
1
1.1k
歴史的経緯の説明 as code
gfx
7
2.7k
Elasticsearchによる 全文検索の実装 in Rails
gfx
5
9.4k
すばらしきGraphQLのSEKAIへようこそ
gfx
20
9.2k
マルチテナント・ウェブアプリケーションの実践
gfx
14
9.4k
How to choose the ORM on Android
gfx
1
4.1k
How Do We Get Along With Static Types
gfx
5
3.3k
Other Decks in Technology
See All in Technology
Zennのパフォーマンスモニタリングでやっていること
ryosukeigarashi
0
110
Introduction to Works of ML Engineer in LY Corporation
lycorp_recruit_jp
0
130
Taming you application's environments
salaboy
0
190
Engineer Career Talk
lycorp_recruit_jp
0
180
安心してください、日本語使えますよ―Ubuntu日本語Remix提供休止に寄せて― 2024-11-17
nobutomurata
1
1k
100 名超が参加した日経グループ横断の競技型 AWS 学習イベント「Nikkei Group AWS GameDay」の紹介/mediajaws202411
nikkei_engineer_recruiting
1
170
ドメイン名の終活について - JPAAWG 7th -
mikit
33
20k
B2B SaaSから見た最近のC#/.NETの進化
sansantech
PRO
0
860
Lambda10周年!Lambdaは何をもたらしたか
smt7174
2
110
Can We Measure Developer Productivity?
ewolff
1
150
New Relicを活用したSREの最初のステップ / NRUG OKINAWA VOL.3
isaoshimizu
2
610
Terraform CI/CD パイプラインにおける AWS CodeCommit の代替手段
hiyanger
1
240
Featured
See All Featured
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
890
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.1k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Transcript
ORMͷબͼํ ~ Androidฤ ~ #potatotips 2016/03/16 @__gfx__
ࣗݾհ • Engineer at eBook Initiative Japan • Android Engineer
• Recent Works: Android ORM, Static Gson, Robolectric-Instrumentation • rebuild.fm/133 ͰAndroid NͷΛͨ͠
None
ORM for Android • ͍·͍ͪϕετϓϥΫςΟε͕ఆ·Βͳ͍ྖҬ • ੲʮ͍͢͞ͷActiveAndroidʯͱʮͷ GreenDAOʯ͘Β͍͔͠બࢶ͕ͳ͔ͬͨ • ࠓ΄͔ʹDBFlow,
Requery, OrmaͳͲଟ • NoSQLͷRealmORMػೳΛͭDBͱͯ͠͞Ε ͍ͯΔ
ORMʹٻΊΔͷ • : ϦϑϨΫγϣϯ͍ɻίʔυੜ͖͢ • ϚΠάϨʔγϣϯ: ϚΠάϨʔγϣϯ͕ͭΒ͍ͱ ؾܰʹ͑ͳ͍ɻΧϥϜͷՃ͘Β͍ࣗಈͰͬ ͯ͘Ε •
؆୯: ੍Λ՝͞ͳ͍͜ͱʢe.g. ಛఆͷεʔύʔ Ϋϥε͕ඞཁʣɺίʔυิͱͷ૬ੑͷΑ͞
• AA: ϦϑϨΫγϣϯ༻ɻ͍ • DBFlow, Orma: ίʔυੜɻ͍ • Realm:
ಠࣗDB࣮ɻ͍ ※ ͳ͓Realmߴͱ͍ΘΕΔ͕ɺOrmaDBFlowͱ ͘ΒΔͱʮ͍έʔε͕͋Δʯͱ͍͏ఔ
ϚΠάϨʔγϣϯ • खͰϚΠάϨʔγϣϯίʔυΛॻ͖ͨ͘ͳ͍ w ""WFSTJPOTRMʹ42-Λॻ͘ w %#'MPXBEE$PMVNO -POHDMBTT UJNFTUBNQ
w 0SNBϦωʔϜҎ֎ίʔυෆཁ w 3FBMNBEE'JFME JE MPOHDMBTT
؆୯͞(1): Ϟσϧͷ੍ • ActiveAndroidRealmModelΫϥεΛܧঝ͢Δඞཁ͕͋Γɺ JSON serializeͳͲͰϋϚΔ • AAউखʹprimary keyΛ͚ͭͯϋϚΔ •
Orma, Requery੍ͳ͠ɺDBFlowΠϯλʔϑΣΠεͷ࣮ ΛٻΊΔ ※ ҎલͷRelamϞσϧϝιουΛఆٛͰ͖ͳ͍ͳͲͷ੍͕͋ͬ ͕ͨɺv0.88Ͱ΄ͱΜͲղফ͞Εͨ
؆୯͞(2): ΫΤϦϏϧμ • ίʔυίϯϓϦʔτͱͷ૬ੑΛߟ͑Δ • ""OFX4FMFDU GSPN *UFNDMBTT XIFSF OBNF
+BDL • %#'MPX 42-JUFTFMFDU GSPN *UFNDMBTT XIFSF *UFN@5BCMFOBNFFR +BDL • 0SNBPSNBTFMFDU'SPN*UFN OBNF&R +BDL • 3FBMNSFBMNXIFSF *UFNDMBTT FRVBMT OBNF +BDL
݁ • AAΛ͏ཧ༝ͳ͍ • Orma·͋·͋ΠέͯΔ • DBFlowͳ͔ͳ͔Α͍ɻϚΠάϨʔγϣϯ͠ͳ͍ͳ Β • Realm0.88͔Β͍ͩͿΑ͘ͳͬͨɻϚΠάϨʔγϣ
ϯ͠ͳ͍ͳΒ
OrmaͷΠέͯͳ͍ͱ͜Ζ • ރΕͯͳ͍ʢ։ൃΛ͡Ίͯ3ϲ݄͘Β͍ʣ • ෳࡶͳΫΤϦΛߏஙͰ͖ͳ͍ • has-one, has-many, many-to-manyͳͲͷ associationsͷαϙʔτ͕ශऑ
• ίʔυੜܥҰൠͷͱͯ͠ɺίϯύΠϧΤϥʔʹ ͳͬͨͱ͖ʹؔͳ͍Τϥʔ͕େྔʹग़ͯͭΒ͍
͓·͚: APK sizes • Normal App: 0.85MiB • Orma App:
0.97MB • Realm App: 5.30MB https://github.com/gfx/ORM-APK-Size-Example
https://github.com/gfx/Android-Orma