Upgrade to Pro — share decks privately, control downloads, hide ads and more …

もしイチゴ農家の園主がSmalltalkの「Seaside」(で作られたシステム)を使ってみたら

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.

 もしイチゴ農家の園主がSmalltalkの「Seaside」(で作られたシステム)を使ってみたら

愛知県のイチゴ農家がSeasideを使って愛知県トップを目指すストーリー?

Avatar for newapplesho

newapplesho

April 26, 2012

More Decks by newapplesho

Other Decks in Programming

Transcript

  1. ϑϩʔ੍ޚ Ұൠը໘ ༧໿ը໘ ΧϨϯ μʔදࣔ ॲཧ Ϣʔβૢ࡞ γεςϜભҠ ༧໿ঢ়گ ֬ೝը໘

    ʢ࣌ؒʣ ೥ؒΧϨ ϯμʔ ݄ΧϨϯ μʔ ༧໿ ΫϦοΫ ΫϦοΫ ΫϦοΫ ΫϦοΫ ΫϦοΫ ΫϦοΫ ※A ΫϦοΫ ฤू࡟আ ΫϦοΫ ※C ͓٬༷༧໿ೖྗભҠ ΫϦοΫ Ұ൪มΘΓ΍͘͢໘౗ͳͱ͜Ζ 9
  2. 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
  3. ެ։·ͰͷಓͷΓ 6݄ 11 1݄ 9݄ ?݄ ٢ా΁ͷґཔ? ը໘ઃܭ ࢓༷ௐ੔ SeasideͰϓϩλΠϓͰ

    ΠϝʔδΛ࣋ͬͯ΋Β͏ ίϯηϓτͱ ҙࣝվֵ ணखґཔ αʔόߏங WebϖʔδҠߦ ༧໿γεςϜެ։ 2012೥ 2011೥ 14
  4. ެ։΁ͷಓͷΓʢ೔ຊޠͷରԠʣ |adapter| WAComancheAdaptor startOn: 8080. adapter := WAComancheAdaptor default. adapter

    codec: (GRCodec forEncoding: 'utf-8'). adapter isRunning Seaside 3.0ܥͷ৔߹ 18
  5. ެ։΁ͷಓͷΓʢ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
  6. ެ։΁ͷಓͷΓʢը૾ϑΝΠϧͱ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
  7. ެ։΁ͷಓͷΓʢը૾ϑΝΠϧͱCSSʣ >>updateRoot:anHtmlRoot super updateRoot: anHtmlRoot. anHtmlRoot stylesheet resourceUrl: self baseUrl

    ,'main.css'. WAComponent subclass ࠓճͷํ๏ Smalltalk imageͰcss౳Λ؅ཧ͠ͳ͍ •imageϑΝΠϧͷܰྔԽ •ը૾ɼcssͷमਖ਼ΛಠཱͰ͖Δ •Web APͷιʔε͕؅ཧ͠΍͘͢ͳΔ 23
  8. ެ։΁ͷಓͷΓʢPostgreSQLͱͷ઀ଓʣ SqueakDatabaseAccessor DefaultDriver:(Smalltalk at: #NativePostgresDriver). ConfigurationOfGlorpDBX project lastVersion load:'Core'. Glorp※1Λ༻͍Δ

    ※1 ୈ12ճSmalltalkษڧձ ࢿྉࢀߟ GlorpΛී௨ʹ࢖͍͍ͨͳΒCore͕͓͢͢Ί ΠϯετʔϧޙɼPostgreSQLͷυϥΠόʔΛσϑΥϧτͱ͢ΔͨΊҎԼΛ࣮ߦ 26
  9. ެ։΁ͷಓͷΓʢ͓·͚ʣ renderContentOn: html ! self requestContext respond: [:response | !

    ! response ! ! initializeOn: self svg ; contentType: 'text/xml'] WAComponent subclass 30