• 將顆粒度適中的 userstory 與客⼾確認
• ⼀條 user story 可能會包含很多任務,所以不會
直接將⼀個 user story 來開 ticket
• break down to task 可能需要⼀點經驗,可以請
主管或 senior 核對 task 是否合理
將 User Story 拆成任務
資料庫概論相關
U N IO N (聯集) ∪
INTERSECTION ( 交集) ∩
SET DIFFERENCE ( 差集)
C A RT E S I A N P R O D U C T (卡⽒積) ×
SELECT ( 選擇) σ
R O J E C T (投射) π
JOIN (合併) ⋈
D I V I S I O N (除法) ÷
關聯式代數
資料庫正規化
Transaction
103.
Active Record 原理
《Ra i l s 探索:A c t i v e R e c o r d 篇》
— Johnson fr om 5 xRuby
• 實作⼀個簡單的 A c t i v e R e c o r d
• 了解 Relation Object 原理
• 幫助理解在 Rails 中使⽤ A c t i v e
R e c o r d 中的⼀些效能問題
104.
Active Record 原理
《如何在Rails 中使⽤ A r e l
SQL》
— Lance f rom 5xRub y
ActiveRecord 會使⽤ A r e l 來建
立 SQL 的語法樹
《Refacoring Ruby Edition》
DuplicatedCode
Long Method
Large Class
Long Parameter List
Divergent Change
Shotgun Surgery
Feature Envy
Data Clump
Primitive Obsession
Case Statement
Parallel Inheritance Hierarchies
Lazy Class
Speculative Generality
Temporary Field
Message Chains
Middle Man
Inappropriate Intimacy
Alternative Classes with Different Interface
Incomplete Library Class
Data Class
Refused Bequest
Comment
Meta Programming Madness
Disjointed API
Repetitive Boilerplate
聞聞看 Code smell ㄉ味道
def keys_of_null(hsh, check_only)
ifcheck_only.nil?
result = []
hsh.each do |k, v|
result << k if v.nil?
end
if result.empty?
"all good"
else
result
end
else
result = []
hsh.each do |k, v|
result << k if check_only.include(k) && v.nil?
end
if result.empty?
"all good"
else
result
end
end
end
155.
def keys_of_null(hsh, check_only)
ifcheck_only.nil?
result = []
hsh.each do |k, v|
result << k if v.nil?
end
if result.empty?
"all good"
else
result
end
else
result = []
hsh.each do |k, v|
result << k if check_only.include(k) && v.nil?
end
if result.empty?
"all good"
else
result
end
end
end
把功能相似的標註出來
156.
def keys_of_null(hsh, check_only)
check_only= check_only.nil? ? hsh.keys : check_only
result = []
hsh.each do |k, v|
result << k if check+only.include(k) && v.nil?
end
result.empty? ? "all good" : result
end
整理在⼀起