Suche senden
Hochladen
Design pattern chapter_3_template_pattern
•
0 gefällt mir
•
934 views
Daegwon Kim
Folgen
Desingn Pattern in Ruby 3장 Template Pattern 발표 1월 4일(토), 강남 토즈
Weniger lesen
Mehr lesen
Technologie
Diashow-Anzeige
Melden
Teilen
Diashow-Anzeige
Melden
Teilen
1 von 40
Jetzt herunterladen
Downloaden Sie, um offline zu lesen
Empfohlen
Element of design
Element of design
Element of design
Rahul Gupta
Art and design
Element of design texture
Element of design texture
Mau Palm
Elements & Principles of Art Design PowerPoint
Elements & Principles of Art Design PowerPoint
emurfield
Elements of interior design, history,importance, main elements of interior design- line, shape, space, form,texture, colour in detail, their uses and charecteristics in interior design.method of achieving nice composition using these elements vs nice examples and illustration.
Elements of interior design
Elements of interior design
Sumit Ranjan
An overview of the Elements and Principles of Art (for 8th grade and up)
Elements And Principles of Art
Elements And Principles of Art
kpikuet
야신 프로젝트
2015 07 31_yashin_project
2015 07 31_yashin_project
Daegwon Kim
nacyot 2015. 07. 15. 토즈 강남타워점 InfovisKr 고전 독서 모임 첫 모임
InfovisKr 고전 독서 모임 소개 - The Grammar of Graphics
InfovisKr 고전 독서 모임 소개 - The Grammar of Graphics
Daegwon Kim
루비 열거자 이해하기 2014. 12. 09. 제 76회 RORLab 서울 강남 토즈 2호점
Ruby Enumerator(루비 열거자) 이해하기
Ruby Enumerator(루비 열거자) 이해하기
Daegwon Kim
Empfohlen
Element of design
Element of design
Element of design
Rahul Gupta
Art and design
Element of design texture
Element of design texture
Mau Palm
Elements & Principles of Art Design PowerPoint
Elements & Principles of Art Design PowerPoint
emurfield
Elements of interior design, history,importance, main elements of interior design- line, shape, space, form,texture, colour in detail, their uses and charecteristics in interior design.method of achieving nice composition using these elements vs nice examples and illustration.
Elements of interior design
Elements of interior design
Sumit Ranjan
An overview of the Elements and Principles of Art (for 8th grade and up)
Elements And Principles of Art
Elements And Principles of Art
kpikuet
야신 프로젝트
2015 07 31_yashin_project
2015 07 31_yashin_project
Daegwon Kim
nacyot 2015. 07. 15. 토즈 강남타워점 InfovisKr 고전 독서 모임 첫 모임
InfovisKr 고전 독서 모임 소개 - The Grammar of Graphics
InfovisKr 고전 독서 모임 소개 - The Grammar of Graphics
Daegwon Kim
루비 열거자 이해하기 2014. 12. 09. 제 76회 RORLab 서울 강남 토즈 2호점
Ruby Enumerator(루비 열거자) 이해하기
Ruby Enumerator(루비 열거자) 이해하기
Daegwon Kim
Dockerrizing newrelic-sysmond Docker Korea - Docker Casual Talk #2 Toz Tower Gangnam Dec 3, 2014 Dockerfile link - https://github.com/nacyot/docker-logs/blob/master/newrelic-sysmond/busybox/Dockerfile
Docker Casual Talk #2 - Dockerizing newrelic-sysmond
Docker Casual Talk #2 - Dockerizing newrelic-sysmond
Daegwon Kim
Kubernetes Introduction GDG Devfair 2014 @nacyo_t Maru 180
Devfair kubernetes 101
Devfair kubernetes 101
Daegwon Kim
Docker Introduction
Docker introduction
Docker introduction
Daegwon Kim
도커 코리아 두번째 모임(2014년 8월 2일) 도커(Docker) 메트릭스 & 로그 수집 @nacyot
도커(Docker) 메트릭스 & 로그 수집
도커(Docker) 메트릭스 & 로그 수집
Daegwon Kim
2014. 07. 23. RORLab 강남 토즈 2호점 커맨드 라인 도구 활용하기 - zsh + oh-my-zsh, tmux, peco 발표 영상 : http://www.youtube.com/watch?v=HGPp-FnUNKM
커맨드 라인 도구 활용하기 - zsh + oh-my-zsh, tmux, peco
커맨드 라인 도구 활용하기 - zsh + oh-my-zsh, tmux, peco
Daegwon Kim
Introduction to Concept of Translation Memory and Usage of Google Translator Toolkit Rails Tutorial Korean Translation Team Gangnam Toz 2014. 07. 15.
Translation memory
Translation memory
Daegwon Kim
2014 Programer 세미나 데이 발표.
이미지 기반의 배포 패러다임 Immutable infrastructure
이미지 기반의 배포 패러다임 Immutable infrastructure
Daegwon Kim
on oct 23, 2013 at Dev.study by nacyot(Daekwon Kim)
Visualization and data mapping
Visualization and data mapping
Daegwon Kim
on oct 12, 2013 at Daum hannam office by nacyot(Daekwon Kim)
Movie explorer - Moplo! Introduction
Movie explorer - Moplo! Introduction
Daegwon Kim
on sep 21, 2013 at Naver Greenfactory(D2fest final) by nacyot(Kim Daekwon)
Ruby codemetric automation server - Putne Introduction
Ruby codemetric automation server - Putne Introduction
Daegwon Kim
from http://slid.es/nacyot/ruby on aug 2013 at Dev.study by nacyot(Kim Daekwon)
Ruby for biginner - Don't be suprised
Ruby for biginner - Don't be suprised
Daegwon Kim
Weitere ähnliche Inhalte
Mehr von Daegwon Kim
Dockerrizing newrelic-sysmond Docker Korea - Docker Casual Talk #2 Toz Tower Gangnam Dec 3, 2014 Dockerfile link - https://github.com/nacyot/docker-logs/blob/master/newrelic-sysmond/busybox/Dockerfile
Docker Casual Talk #2 - Dockerizing newrelic-sysmond
Docker Casual Talk #2 - Dockerizing newrelic-sysmond
Daegwon Kim
Kubernetes Introduction GDG Devfair 2014 @nacyo_t Maru 180
Devfair kubernetes 101
Devfair kubernetes 101
Daegwon Kim
Docker Introduction
Docker introduction
Docker introduction
Daegwon Kim
도커 코리아 두번째 모임(2014년 8월 2일) 도커(Docker) 메트릭스 & 로그 수집 @nacyot
도커(Docker) 메트릭스 & 로그 수집
도커(Docker) 메트릭스 & 로그 수집
Daegwon Kim
2014. 07. 23. RORLab 강남 토즈 2호점 커맨드 라인 도구 활용하기 - zsh + oh-my-zsh, tmux, peco 발표 영상 : http://www.youtube.com/watch?v=HGPp-FnUNKM
커맨드 라인 도구 활용하기 - zsh + oh-my-zsh, tmux, peco
커맨드 라인 도구 활용하기 - zsh + oh-my-zsh, tmux, peco
Daegwon Kim
Introduction to Concept of Translation Memory and Usage of Google Translator Toolkit Rails Tutorial Korean Translation Team Gangnam Toz 2014. 07. 15.
Translation memory
Translation memory
Daegwon Kim
2014 Programer 세미나 데이 발표.
이미지 기반의 배포 패러다임 Immutable infrastructure
이미지 기반의 배포 패러다임 Immutable infrastructure
Daegwon Kim
on oct 23, 2013 at Dev.study by nacyot(Daekwon Kim)
Visualization and data mapping
Visualization and data mapping
Daegwon Kim
on oct 12, 2013 at Daum hannam office by nacyot(Daekwon Kim)
Movie explorer - Moplo! Introduction
Movie explorer - Moplo! Introduction
Daegwon Kim
on sep 21, 2013 at Naver Greenfactory(D2fest final) by nacyot(Kim Daekwon)
Ruby codemetric automation server - Putne Introduction
Ruby codemetric automation server - Putne Introduction
Daegwon Kim
from http://slid.es/nacyot/ruby on aug 2013 at Dev.study by nacyot(Kim Daekwon)
Ruby for biginner - Don't be suprised
Ruby for biginner - Don't be suprised
Daegwon Kim
Mehr von Daegwon Kim
(11)
Docker Casual Talk #2 - Dockerizing newrelic-sysmond
Docker Casual Talk #2 - Dockerizing newrelic-sysmond
Devfair kubernetes 101
Devfair kubernetes 101
Docker introduction
Docker introduction
도커(Docker) 메트릭스 & 로그 수집
도커(Docker) 메트릭스 & 로그 수집
커맨드 라인 도구 활용하기 - zsh + oh-my-zsh, tmux, peco
커맨드 라인 도구 활용하기 - zsh + oh-my-zsh, tmux, peco
Translation memory
Translation memory
이미지 기반의 배포 패러다임 Immutable infrastructure
이미지 기반의 배포 패러다임 Immutable infrastructure
Visualization and data mapping
Visualization and data mapping
Movie explorer - Moplo! Introduction
Movie explorer - Moplo! Introduction
Ruby codemetric automation server - Putne Introduction
Ruby codemetric automation server - Putne Introduction
Ruby for biginner - Don't be suprised
Ruby for biginner - Don't be suprised
Design pattern chapter_3_template_pattern
1.
루비디자인패턴:템플릿패턴 김대권 propellerheaven@gmail.com
2.
템플릿패턴
3.
시나리오 레포트생성기
4.
HTMLReport 간단한월례보고서생성기 제목과본문필요 HTML포맷만잘출력
5.
Report클래스 classReport definitialize @title='MonthlyReport' @text=['Thingsaregoing','really,reallywell.'] end defoutput_report puts('html') puts('head') puts(title#{@title}/title) puts('/head') puts('body') @text.eachdo|line| puts(p#{line}/p) end puts('/body') puts('/html') end end
6.
Report클래스(cont.) report=Report.new report.output_report
7.
하지만현실은…
8.
다양한출력형식? 이렇게도해야하고 저렇게도해야하고 나중엔그렇게도해야할지도모르는
9.
월례리포트생성기 HTML포맷 Text포맷
10.
Report클래스 일단은고치고보자
11.
수정된Report클래스 defoutput_report(format) ifformat==:plain puts(***#{@title}***) elsifformat==:html puts('html') puts('head') puts(title#{@title}/title) puts('/head') puts('body') else raiseUnknownformat:#{format} end @text.eachdo|line| ifformat==:plain puts(line) else puts(p#{line}/p) end end ifformat==:html puts('/body') puts('/html') end
12.
회고 if문을사용한분기 모든처리를outputreport에서하고있음 뭔가이게아닌것같은데…모르겠다 …
13.
다시월례리포트생성기 HTML로보내주세요. Text로도보내주세요. RTF가필요해요. PostScript포맷이필요해요. …
14.
15.
템플릿패턴
16.
레포트생성과정 1. Outputsanyheaderinformationrequiredbythespecificformat. 2. Outputthetitle. 3.
Outputeachlineoftheactualreport. 4. Outputanytrailingstuffrequiredbytheformat.
17.
outputreportMethod defoutput_report output_start output_head output_body_start output_body output_body_end output_end end
18.
AbstractMethod defoutput_start raise'Calledabstractmethod:output_start' end defoutput_head raise'Calledabstractmethod:output_head' end defoutput_body_start raise'Calledabstractmethod:output_body_start' end defoutput_line(line) raise'Calledabstractmethod:output_line' end defoutput_body_end raise'Calledabstractmethod:output_body_end' end defoutput_end raise'Calledabstractmethod:output_end' end
19.
HTMLReport classHTMLReportReport defoutput_start puts('html') end defoutput_head puts('head') puts(title#{@title}/title) puts('/head') end defoutput_body_start puts('body') end defoutput_line(line) puts(p#{line}/p) end defoutput_body_end puts('/body') end defoutput_end puts('/html')
20.
TextReport classPlainTextReportReport defoutput_start end defoutput_head puts(****#{@title}****) puts end defoutput_body_start end defoutput_line(line) putsline end defoutput_body_end end defoutput_end end end
21.
Report생성하기 report=HTMLReport.new report.output_report report=PlainTextReport.new report.output_report
22.
템플릿패턴클래스다이어그램
23.
HookMethods 상속클래스에서오버라이드해서사용할수도있음 기본기능을제공
24.
Report클래스 classReport ... defoutput_start end defoutput_body_start end ... defoutput_body_end end defoutput_end end end
25.
PlainTextReport outputbodystart와outputbodyend는빈메소드 HTML레포트에서body태그가들어가는메소드
26.
PlainTextReport classPlainTextReportReport defoutput_start end defoutput_head puts(****#{@title}****) puts end defoutput_line(line) puts(line) end defoutput_end end end
27.
DuckTyping 오리같이생겼고, 꽥꽥대면 오리
28.
정적타입언어의비용 1. 타입선언 2. 프로그램이시스템에강하게묶이는문제
29.
emptyMethod예제
30.
Java예제 publicclassEmpty { publicbooleanisEmpty(Strings) { returns.length()==0; } }
31.
Ruby예제 defempty?(s) s.length==0 end
32.
RubyvsJava DuckTyping에서는length가있는모든클래스에서사용가능
33.
UnitTest 테스트는어느언어에서건필수 xUnit
34.
Setup classEmptyTestTest::Unit::TestCase defsetup @empty_string='' @one_char_string='X' @long_string='TheraininSpain' @empty_array=[] @one_element_array=[1] @long_array=[1,2,3,4,5,6] end ... end
35.
Test classEmptyTestTest::Unit::TestCase ... deftest_empty_on_strings assertempty?(@empty_string) assert!empty?(@one_char_string) assert!empty?(@long_string) end deftest_empty_on_arrays assertempty?(@empty_array) assert!empty?(@one_element_array) assert!empty?(@long_array) end end
36.
함정 하나에서부터시작하기 이예제에서는HTML에서시작하기 모든경우를커버하려고하지말것
37.
TemplatesintheWild
38.
Webrick서버 classHelloServerWEBrick::GenericServer defrun(socket) socket.print('HelloTCP/IPworld') end end s=HelloServer.new(:Port=2000) trap(INT){s.shutdown} s.start
39.
RubyinitializeMethod
40.
Thankyou
Jetzt herunterladen