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
もしイチゴ農家の園主がSmalltalkの「Seaside」(で作られたシステム)を使ってみたら
Search
newapplesho
April 26, 2012
Programming
0
76
もしイチゴ農家の園主がSmalltalkの「Seaside」(で作られたシステム)を使ってみたら
愛知県のイチゴ農家がSeasideを使って愛知県トップを目指すストーリー?
newapplesho
April 26, 2012
Tweet
Share
More Decks by newapplesho
See All by newapplesho
OpenRestyについて
newapplesho
0
85
Continuous Integration for Pharo Smalltalk Part 2 (Travis CI)
newapplesho
0
170
今時なウェブ開発をSmalltalkでやってみる?
newapplesho
0
120
Continuous Integration for Pharo Smalltalk
newapplesho
0
130
Elasticsearch for Pharo Smalltalk
newapplesho
0
150
SourceCode Management with Pharo Smalltalk - Pharo Smalltalkソースコード管理方法
newapplesho
0
110
RUNNING Smalltalk - 実践Smalltalk
newapplesho
0
90
AWS SDK for Smalltalk
newapplesho
0
90
How Smalltalker Works
newapplesho
0
78
Other Decks in Programming
See All in Programming
Refactor your code - refactor yourself
xosofox
1
260
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
550
コンテナをたくさん詰め込んだシステムとランタイムの変化
makihiro
1
130
PHPで作るWebSocketサーバー ~リアクティブなアプリケーションを知るために~ / WebSocket Server in PHP - To know reactive applications
seike460
PRO
2
430
htmxって知っていますか?次世代のHTML
hiro_ghap1
0
340
Webエンジニア主体のモバイルチームの 生産性を高く保つためにやったこと
igreenwood
0
340
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
330
責務を分離するための例外設計 - PHPカンファレンス 2024
kajitack
6
1.1k
情報漏洩させないための設計
kubotak
2
220
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
170
採用事例の少ないSvelteを選んだ理由と それを正解にするためにやっていること
oekazuma
2
1k
HTTP compression in PHP and Symfony apps
dunglas
2
1.7k
Featured
See All Featured
The Cult of Friendly URLs
andyhume
78
6.1k
How to Think Like a Performance Engineer
csswizardry
22
1.2k
Gamification - CAS2011
davidbonilla
80
5.1k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Automating Front-end Workflow
addyosmani
1366
200k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.4k
RailsConf 2023
tenderlove
29
940
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
32
2.7k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
Side Projects
sachag
452
42k
Transcript
٢ాɹᠳ ͠ΠνΰՈͷԂओ͕SmalltalkͷʮSeasideʯʢͰ ࡞ΒΕͨγεςϜʣΛͬͯΈͨΒ ѪݝͷΠνΰՈ͕SeasideΛͬͯѪݝτοϓΛࢦ͢ετʔϦʔʁ 1
http://swikis.ddo.jp/umejava/38 ຊॳʁSeasideͷհϖʔδ ͜ΕҎ߱Կճ͔հ͞Ε͍ͯΔ͚Ͳ ʮެ։ͨ͠ΑʯͬͯΛฉ͔ͳ͍ 2
Ͱ͖ͨɽऴྃʂ ࡞ͬͯΈΔ νϡʔτϦΞϧ ࣮ࡍʹҰൠެ։ͯ͠Έͨ ※ຊ৬ͱؔ͋Γ·ͤΜ 3
͍ͪ͝ङΓ༧ཧγεςϜ ᖒాԂɹhttp://www.sawadafarm.com 4
༧γεςϜͷಋೖܦҢ̍ ͍ͪ͝ङΓ༧ిͱFAX هɾཧ ͝ͱʹཧ ༧ใࢴʹه ᣀङΓ͍ͨ͠ 5
γεςϜಋೖલͷ Γ͍ͨใͲ͜ʹʁ ༷ࢠ͕͔Βͳ͍ •ࢠͲͰऔΕΔͷ͔ •ԚΕͳ͍͔ •௨࿏͍͔ ใ͕ෳࡶ 6
ίϯηϓτ sawadafarm.com ༧ཧγεςϜ ̍Ͱͬͯ10Ͱ༧ ᖒాԂαΠτ sawadafarm.com αΠτશମΛ༧γεςϜͱ͢Δ ̍Ͱͬͯ10Ͱཧ 7
ͳͥSeasideʁ • ϙʔλϒϧͳڥͰ͋ͬͨ͜ͱ • ༧ը໘ͷϓϩτλΠϓ̏࣌ؒͰ࡞ͬͯɼΠϝʔδΛ࣋ͬͯΒ͑ͨ • ϖʔδભҠͷهड़͕ඇৗʹָͳ͜ͱ • SmalltalkͰ࡞ͬͨγεςϜΛҰൠެ։ͯ͠Έ͔ͨͬͨ •
PHPɼRubyɼJavaԿͱͳ͘ॻ͚Δ͚Ͳɾɾɾ 8
ϑϩʔ੍ޚ Ұൠը໘ ༧ը໘ ΧϨϯ μʔදࣔ ॲཧ Ϣʔβૢ࡞ γεςϜભҠ ༧ঢ়گ ֬ೝը໘
ʢ࣌ؒʣ ؒΧϨ ϯμʔ ݄ΧϨϯ μʔ ༧ ΫϦοΫ ΫϦοΫ ΫϦοΫ ΫϦοΫ ΫϦοΫ ΫϦοΫ ※A ΫϦοΫ ฤूআ ΫϦοΫ ※C ͓٬༷༧ೖྗભҠ ΫϦοΫ Ұ൪มΘΓ͘͢໘ͳͱ͜Ζ 9
ϑϩʔ੍ޚ ྫ: ϩάΠϯ࣌ͷϑϩʔ Web։ൃͰΉॲཧ ೝূޭ ొ ೝূࣦഊ Login main page
User register 10
login user register main ೝূޭ ొ ೝূࣦഊ 11
ϑϩʔ੍ޚ WATask>>goͰϑϩʔશମΛهड़ MyLoginComponent MyUserRegisterComponent MyMainComponent MyTask call: answer: ೝূࣦഊ ೝূޭ
ॊೈͳϑϩʔ੍ޚ͕هड़Մೳ 12
MyTask>>go ! | user | ! loginAnswer:= self call:(MyLoginComponent new).
! loginAnswer = #registerUser ! ! ifTrue:[ user := self call: (MyUserRegisterComponent new) ] ifFalse:[ user := loginAnswer ]. ! user ifNotNil:[ ! ! self session login: user.]. self call:(MyMainComponent new). WATask subclass:#MyTask ϑϩʔ੍ޚ 13
ެ։·ͰͷಓͷΓ 6݄ 11 1݄ 9݄ ?݄ ٢ాͷґཔ? ը໘ઃܭ ༷ௐ SeasideͰϓϩλΠϓͰ
ΠϝʔδΛ࣋ͬͯΒ͏ ίϯηϓτͱ ҙࣝվֵ ணखґཔ αʔόߏங WebϖʔδҠߦ ༧γεςϜެ։ 2012 2011 14
ίϯηϓτ γϯϓϧ͔ͭײత 15
ཁ݅ ᶃ༧݄Λબ ᶄ༧࣌ؒΛબ ᶅ໊લͱΞυϨεೖྗ ϝʔϧͰຊਓ֬ೝ 16
γεςϜߏ Apache PostgreSQL Web AP (Smalltalk) ϝʔϧ৴ػೳ ʢόονॲཧʣ Comanche 17
ެ։ͷಓͷΓʢຊޠͷରԠʣ |adapter| WAComancheAdaptor startOn: 8080. adapter := WAComancheAdaptor default. adapter
codec: (GRCodec forEncoding: 'utf-8'). adapter isRunning Seaside 3.0ܥͷ߹ 18
ެ։ͷಓͷΓʢ։ൃπʔϧͷআʣ WAAdmin applicationDefaults removeParent: WADevelopmentConfiguration instance WAAdmin applicationDefaults addParent: WADevelopmentConfiguration
instance πʔϧͷআ πʔϧͷՃ 19
ެ։ͷಓͷΓʢApacheͱͷ࿈ܞʣ Apache Web AP (Smalltalk) Comanche Server port:3000 port:80 access.html
੩తͰՄೳͳϖʔδSeasideͰѻΘͳ͍ ApacheͷRewriteػೳΛ࣮ͬͯݱ <VirtualHost *:80> RewriteEngine On RewriteRule ^/(swd.*)$ http://localhost:3000/$1 [P,L] </VirtualHost> httpd.confʹrewriteϧʔϧΛهࡌ͢Δ http://www.sawadafarm.com/swdreservation http://www.sawadafarm.com/access.html 20
ެ։ͷಓͷΓʢը૾ϑΝΠϧͱCSSʣ WAFileLibraryͷsubclassΛ࡞ MyFileLibrary addFileAt:'./css/main.css'. MyFileLibrary addAllFilesIn: './css/'. ·ͨ Workspace্ͰҎԼͷίʔυΛ࣮ߦ ҰൠతʹimageϑΝΠϧʹऔΓࠐΉํ๏͕͋Δ
21
ެ։ͷಓͷΓʢը૾ϑΝΠϧͱCSSʣ >>updateRoot:anHtmlRoot super updateRoot: anHtmlRoot. anHtmlRoot stylesheet url: MyFileLibrary /
#mainCss. >>(class) initialize ! |app| ! app := (WAAdmin register: self asApplicationAt: '...') ! ! addLibrary: MyFileLibrary. WAComponent subclass WAComponent subclass ϥΠϒϥϦͷબ 22
ެ։ͷಓͷΓʢը૾ϑΝΠϧͱCSSʣ >>updateRoot:anHtmlRoot super updateRoot: anHtmlRoot. anHtmlRoot stylesheet resourceUrl: self baseUrl
,'main.css'. WAComponent subclass ࠓճͷํ๏ Smalltalk imageͰcssΛཧ͠ͳ͍ •imageϑΝΠϧͷܰྔԽ •ը૾ɼcssͷमਖ਼ΛಠཱͰ͖Δ •Web APͷιʔε͕ཧ͘͢͠ͳΔ 23
ެ։ͷಓͷΓʢόονͷݺͼग़͠ʣ ϝʔϧૹ৴ػೳSmalltalkͰ࡞Εͳ͔ͬͨ Ծ༧௨ ຊ༧௨ Ωϟϯηϧ͓ΑͼࣗಈΩϟϯηϧ௨ લ༧ूܭ௨ ͓٬༷࣭௨ ͕࣌ؒͳ͔ͬͨ ຊޠͷऔΓѻ͍ʹݒ೦͕͋ͬͨ ϝʔϧૹ৴ػೳ
ཧ༝ 24
ެ։ͷಓͷΓʢόονͷݺͼग़͠ʣ OSProcess command:ʼcancelMail.rbʼ. ※࣮ࡍʹઈରύεͰεΫϦϓτΛࢦఆ͢Δ͜ͱ OSProcessΛ༻͍Δ MetacelloͷϓϩδΣΫτͷConfigurationOfOSProcess※1 ಋೖ͢ΕΑ͍ System performOnServer: 'date'
Gemstoneͷ߹ OSProcessෆཁ Web AP (Smalltalk) ϝʔϧ৴ػೳ ʢόονॲཧʣ ※1 ୈ23ճSmalltalkษڧձ ࢿྉࢀߟ 25
ެ։ͷಓͷΓʢPostgreSQLͱͷଓʣ SqueakDatabaseAccessor DefaultDriver:(Smalltalk at: #NativePostgresDriver). ConfigurationOfGlorpDBX project lastVersion load:'Core'. Glorp※1Λ༻͍Δ
※1 ୈ12ճSmalltalkษڧձ ࢿྉࢀߟ GlorpΛී௨ʹ͍͍ͨͳΒCore͕͓͢͢Ί ΠϯετʔϧޙɼPostgreSQLͷυϥΠόʔΛσϑΥϧτͱ͢ΔͨΊҎԼΛ࣮ߦ 26
ެ։ͷಓͷΓʢιʔείʔυͷཧʣ ҰൠతʹMonticello͓Αͼ SqueakSourceͷαʔόΛཱͯͯཧ ࠓճ GitΛར༻ •HTMLϑΝΠϧͷཧߦ͏ඞཁ͕͋ͬͨͨΊ ɹɹ※Source.stΛཧ͢Δ͚ͩ •SSL௨৴ͰΞΫηεՄೳ •ݱࡏɼΫϥε୯ҐͷstϑΝΠϧΛग़ྗͯ͠ཧ͢ΔπʔϧΛݕ౼த 27
ެ։ͷಓͷΓʢόάͷཧʣ Redmine νέοτཧ͓ΑͼλεΫཧ͕ศར ͢Έ·ͤΜRubyͰ͢ɾɾɾ 28
ެ։ͷಓͷΓʢ͓·͚ʣ ࣗಈੜ͞ΕΔXHMTMLҎ֎ͷใͷग़ྗ •XML, RSS,SVG... •ը૾ϑΝΠϧͷμϯϩʔμ ֶੜͷࠒͰWard๏Ϋϥελʔੳͨ͠ͷͷΛ σϯυϩάϥϜΛදݱΛ࡞Δͱ͖ʹ׆༻ 29
ެ։ͷಓͷΓʢ͓·͚ʣ renderContentOn: html ! self requestContext respond: [:response | !
! response ! ! initializeOn: self svg ; contentType: 'text/xml'] WAComponent subclass 30
ެ։ͷಓͷΓʢ͓·͚ʣ ResponseΛ༻͍ͨsvgͷग़ྗ 31
σϞ 32
ݱࡏͷᖒాԂWebαΠτͷঢ়گ • ࡢʢ2010ळʙ2011य़ʣͱൺΔͱαΠτΞΫηε̎ഒ • ༧ௐʢฏۉαΠτࡏ࣌ؒ5ʣ • େ͖ͳγεςϜτϥϒϧͳ͠ • ༧γεςϜެ։ޙɼ̎ճ༷มߋʢੵۃతͳۀվળʣ •
ߋͳΔཁͳͲ্͕͍ͬͯΔ SmalltalkͷγεςϜͰेຬͯ͠Β͑Δ ۩ମతͳ݁ՌՆࠒ 33
SmalltalkΛͬͯྑ͔ͬͨɾѱ͔ͬͨ ྑ͔ͬͨ ѱ͔ͬͨ •ϓϩτλΠϓ͕͙͢ʹ࡞ΕͯΠ ϝʔδΛ࣋ͬͯΒ͑ͨ •SmalltalkʢPharoʣͰύ ϑΥʔϚϯεͱͯ͠ͳ͍͜ ͱ͕࣮ײͰ͖ͨ •ը໘σβΠϯͱۀͯ͠࡞Δͱ େมʢSmalltalkͰHTML·Ͱه
ड़͢Δܽʁʣ •ϩάग़ྗϥΠϒϥϦ •POSIXͷਖ਼نදݱϥΠϒϥϦ͠ ͔ͳ͍ 34
ࠓޙͷվળ • ը໘ઃܭ͔ΒͷSeasideͷөʢը໘ϞοΫΛͲͷΑ͏ʹө͢Δ͔ʣ • ڞ௨ιʔεͷཧʢGitͰͷཧΛ༰қʹ͢Δʣ • ϦΧόϦͱোݕରࡦͷڧԽʢϩάʣ ͦͷଞ SeasideͰόάཧγεςϜ͕͋Δͱ͍͍ͷͰ 35
࡞ͬͯऴΘΓͰͳ͘ެ։͠·͠ΐ͏ 36