More Related Content Similar to Talking About Fluent Interface Similar to Talking About Fluent Interface(20) More from Koji SHIMADA(20) Talking About Fluent Interface1. 2008‐11‐19(Wed); AppleStore, Sapporo
Ruby Sapporo Night vol.8
Talking about “Fluent interface”
snoozer.05@ruby‐sapporo.org
Ruby /Ruby
SHIMADA Koji; Nihon Ruby-no-kai; RubySapporo
http://www.flickr.com/photos/mio-spr/2042538806
6. Neal Ford,
Advanced DSL in Ruby
http://www.nealford.com/downloads/conferences/canonical/Neal_Ford-
Advanced_DSLs_in_Ruby-slides.pdf
7. Neal Ford,
Advanced DSL in Ruby
http://www.nealford.com/downloads/conferences/canonical/Neal_Ford-
Advanced_DSLs_in_Ruby-slides.pdf
8. Neal Ford,
Advanced DSL in Ruby
http://www.nealford.com/downloads/conferences/canonical/Neal_Ford-
Advanced_DSLs_in_Ruby-slides.pdf
44. Evolving an EDSL in Java
http://www.mockobjects.com/files/
evolving_an_edsl.ooplsa2006.pdf
46. ✓
✓
✓
http://www.flickr.com/photos/17258892@N05/2588347668
51. tmp1 = data.grep(/foo/)
tmp2 = tmp1.uniq
tmp3 = tmp2.sort
tmp4 = tmp3.join(“¥n”)
tmp4.display
data.grep(/foo/).uniq.sort.join(“¥n”).display
55. Transcript clear.
Transcript nextPutAll: ‘SHIMADA Koji’.
Transcript cr.
Transcript flush.
Transcript
clear;
nextPutAll: ‘SHIMADA Koji’;
cr;
flush
64. expectation.setCount(once())
.setMethod(“buy”)
.setArgument(eq(QUANTITY));
.setResult(TICKET);
mainframe.expects(once())
.method(“buy”).with(eq(QUANTITY))
.will(returnValue(TICKET));
69. ✓
✓
✓
http://www.flickr.com/photos/17258892@N05/2588347668
74. class Discount
...
def Discount.for
Discount.new
end
def cash(discount)
@for_cash = discount
self
end
end
75. class Discount
...
def Discount.for
Discount.new
end
def cash(discount)
@for_cash = discount
self
end
end
76. class Discount
...
def Discount.for
Discount.new
end
def cash(discount)
@for_cash = discount
self
end
end
77. class Product
...
def apply(discount)
@discount = discount
end
...
end
91. ...a programmer’s job is too communicate
with other programmers, not just a machine.
Programming, then, is a human task
done by humans for humans.
Oh, and writing good code at the same time.
111. 2008‐11‐19(Wed); AppleStore, Sapporo
Ruby Sapporo Night vol.8
Talking about “Fluent interface”
snoozer.05@ruby‐sapporo.org
Ruby /Ruby
SHIMADA Koji; Nihon Ruby-no-kai; RubySapporo
http://www.flickr.com/photos/mio-spr/2042538806