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
Exploring ActiveRecord (Ruby China 2017)
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
leon
September 24, 2017
Programming
0
200
Exploring ActiveRecord (Ruby China 2017)
1. Meatadata: Association; Attribute;
2. ActiveRecord Hierarchies
leon
September 24, 2017
Tweet
Share
Other Decks in Programming
See All in Programming
Fragmented Architectures
denyspoltorak
0
150
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
960
今から始めるClaude Code超入門
448jp
7
8.4k
AIで開発はどれくらい加速したのか?AIエージェントによるコード生成を、現場の評価と研究開発の評価の両面からdeep diveしてみる
daisuketakeda
1
970
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
180
dchart: charts from deck markup
ajstarks
3
990
今こそ知るべき耐量子計算機暗号(PQC)入門 / PQC: What You Need to Know Now
mackey0225
3
370
CSC307 Lecture 05
javiergs
PRO
0
500
Vibe codingでおすすめの言語と開発手法
uyuki234
0
220
[KNOTS 2026登壇資料]AIで拡張‧交差する プロダクト開発のプロセス および携わるメンバーの役割
hisatake
0
250
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
170
FOSDEM 2026: STUNMESH-go: Building P2P WireGuard Mesh Without Self-Hosted Infrastructure
tjjh89017
0
150
Featured
See All Featured
Practical Orchestrator
shlominoach
191
11k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
210
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
240
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.1k
How to Talk to Developers About Accessibility
jct
2
130
The untapped power of vector embeddings
frankvandijk
1
1.6k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.9k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
60
42k
Test your architecture with Archunit
thirion
1
2.1k
Transcript
Confidential Exploring ActiveRecord Leon Confidential
2 Agenda Ø Preface ü Beauty Of Mathematics Ø Metadata
ü Reflection; Association; Attribute Ø Hierarchies ü Scoping Ø Wrapping Up
Introduction
4 FreeWheel是做什么的? 目前90%美国主流电视媒体和运营商使用我们的广告平台。 2014年,我们服务的视频播放超过1250亿次。
5 MRM-FreeWheel的旗舰产品 Monetization Rights Management®
6 FreeWheel的客户
ORM Preface
8 归类 Ø 现有煤气灶、水龙头、水壶和火柴摆在您面前,需要烧水时,须进行如下 操作: ü 往水壶里注满水,点燃煤气,把水壶放到煤气灶上。 Ø 假设现在水壶中的水是满的,其他情况不变,又该怎样去做? ü
物理学家的答案:“点燃煤气,再把水壶放上去。” ü 数学家的答案:“只须把水壶中的水倒掉,问题就化归为前面所说的 问题了。”
9 Ø Hibernate (JAVA) Ø Entity Framework (C#) Ø SQLBoiler
(Golang) Ø Django (Python) Ø ActiveRecord (Ruby)
Real Life Gem
11 Real-life Case: Brand New Copy
12 Tasks Split Up Ø Data Structure: ü Association; Reflection;
Attribute; Graph Ø Algorithm ü Graph copy ü Topology sort ü Priority queue Ø Detail is evil !!
13 ActiveRecord Hierarchies
ActiveRecord Metadata
15 Beauty Of Mathematics
16 Metaphor For Input & Output
17 What's Metadata? - Compiler
18 What's Metadata? - Association
19 Association & Reflection Ø Reflection ü Host; Options Ø
Association: ü Owner ü Reflection ü Target
20
21 Builder & Reflection & Association
22 What's Metadata? - Attribute
23 Attribute Ø Attribute: two dimensions ü Type • data
type; SQL type • casting from/to database type ü Value • Accessor for business model
24
25 Attribute Accessor
ActiveRecord Hierarchies
27 Hierarchies
28 Scoping Ø Scope Ø Relation Ø Scope vs. Relation
Ø Relation vs. Arel
29 Scope
30 Relation
31 Nested Scopes Combined Relation
32 Default Scope Combined Relation
33
Wrapping Up & Abstraction
35 Summary Ø Functionalities ü Metadata Management ü Accessor Methods
Generation ü Scoping && Relation Ø Design ü Meta Programming ü Multiple Layers Design For Single Responsibility ü Interface Over Implementation Ø Program = Data Structure + Algorithm
Confidential THANKS