Share
Embed
Transcript
55 slides
-
Smalltalkษڧձ - Iliad ٢ా ᠳ 2010-05-27 2010-06-01 վྑ൛ Iliad or
Seaside ? 1 20106݄3༵ -
Smalltalkษڧձ - Iliad IliadνϡʔτϦΞϧ SwazooIliad startOn: 9090. αʔόͷىಈ SwazooIliad stop.
αʔόͷఀࢭ WorkspaceͰҎԼͷίʔυΛdo it 4 20106݄3༵ -
Smalltalkษڧձ - Iliad ίϯτϩʔϥʔͷ࡞ ίϯτϩʔϥͰ͋ΔILApplicationͷαϒΫϥεΛ࡞ ʢMyTestApplicationͱͯ͠ఆٛʣ MyTestApplication>>(class)path ! ^'myTestApp' ΞϓϦέʔγϣϯΛݺͼग़ͨ͢ΊͷύεΛࢦఆ͢Δ
WebϒϥβͰ http://localhost:9090/myTestAppʹ ΞΫηε ਅͬനͳը໘͕දࣔ͞ΕΔ 8 20106݄3༵ -
Smalltalkษڧձ - Iliad XHTMLϨϯμϦϯά index ^ [:e | ! !
e text: 'Hello World'. ]. MyTestApplication ϝιουΧςΰϦcontrollersʹ͢Δ͜ͱ σϑΥϧτίϯτϩʔϥͱͯ͠ݺͼग़͞ΕΔindexʹ ҎԼͷίʔυΛهड़ e ILXHTMLElementͷΠϯελϯε MyTestApplication.st 9 20106݄3༵ -
Smalltalkษڧձ - Iliad XHTMLͷϨϯμϦϯά (1) ݟग़͠ <h1>I love Squeak</h1> index
^ [:e | ! ! e h1: 'I love Squeak'. ]. renderContentOn:html html heading:'I love Squeak.' level:1. ILApplication subclass WAComponent subclass 13 20106݄3༵ -
Smalltalkษڧձ - Iliad XHTMLͷϨϯμϦϯά (2) Ϧετ <ul><li>...</li></ul> index ^ [:e
| | ul | ! ! ul := e ul. ! ! #('Apple' 'Banana' 'Orange') do:[:v | | li | ! ! ! li := ul li. ! ! ! li text: v ]]. DomʹΑΔXMLॲཧͱಉ͡Πϝʔδ 15 20106݄3༵ -
Smalltalkษڧձ - Iliad XHTMLͷϨϯμϦϯά (2) Ϧετ <ul><li>...</li></ul> renderContentOn:html ! html
unorderedList:[ ! ! #('Apple' 'Banana' 'Orange') do:[:v | ! ! html listItem:v ]]. 16 20106݄3༵ -
Smalltalkษڧձ - Iliad XHTMLͷϨϯμϦϯά (3) ςʔϒϧ <table border="1"> <tr> <td>Apple</td>
<td>Banana</td> <td>Orange</td> </tr> </table> 17 20106݄3༵ -
Smalltalkษڧձ - Iliad XHTMLͷϨϯμϦϯά (3) ςʔϒϧ index ! ^ [:e
| | table row | ! ! table := e table border:1. ! ! row := table tr. ! ! #('Apple' 'Banana' 'Orange') do:[:v | | td | ! ! ! td := row td. ! ! ! td text: v ]]. ILApplication subclass 18 20106݄3༵ -
Smalltalkษڧձ - Iliad XHTMLͷϨϯμϦϯά (3) ςʔϒϧ renderContentOn:html ! html table
border:1; with:[ ! ! html tableRow:[ ! ! #('Apple' 'Banana' 'Orange') do:[:v | ! ! html tableData:v ]]]. WAComponent subclass 19 20106݄3༵ -
Smalltalkษڧձ - Iliad XHTMLϨϯμϦϯά Raw data index ^ [:e |
! ! e html: '<h1>aaa</h1>'. ]. renderContentOn:html html html:'<h1>aaa</h1>'. WAComponent subclass ILApplication subclass HTMLΛͦͷ··ग़ྗ 20 20106݄3༵ -
Smalltalkษڧձ - Iliad CSS,JavaScriptͷಋೖ४උ MyMemoryDirectory >> path ! ^'stylesheets' MyMemoryDirectory(class)>>initialize
! "self initialize" ! ILFileHandler addDirectory: self new MyMemoryDirectory.st Library.ws ΞϓϦέʔγϣϯΛݺͼग़ͨ͢ΊͷύεΛࢦఆ͢Δ ILFileHandlerʹొ 24 20106݄3༵ -
Smalltalkษڧձ - Iliad ϥΠϒϥϦͷબ styles ! ^#('/stylesheets/main.css') updatePage: aPage !
super updatePage: aPage. ! aPage head stylesheet href: '/stylesheet/main.css' ILApplication subclass ILWidget subclass 26 20106݄3༵ -
Smalltalkษڧձ - Iliad JavaScript HTMLϨϯμϦϯάʹϝοηʔδΛૹΔ͚ͩͰੜ͞ΕΔ JavaScript contents ! ^[:e |
! ! e p onClick:(...); text:'1+1?'.]. ILWidget subclass 28 20106݄3༵ -
Smalltalkษڧձ - Iliad JavaScript,CSSͷಋೖ४උ WAFileLibraryͷsubclassΛ࡞ MyFileLibrary addFileAt:'./css/main.css'. MyFileLibrary addAllFilesIn: './css/'.
·ͨ Workspace্ͰҎԼͷίʔυΛ࣮ߦ 29 20106݄3༵ -
Smalltalkษڧձ - Iliad JavaScript,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 ϥΠϒϥϦͷબ 30 20106݄3༵ -
Smalltalkษڧձ - Iliad ϑϩʔ੍ޚ ྫ: ϩάΠϯ࣌ͷϑϩʔ Web։ൃͰΉॲཧ ೝূޭ ొ ೝূࣦഊ
Login main page User register 32 20106݄3༵ -
Smalltalkษڧձ - Iliad login user register main ೝূޭ ొ ೝূࣦഊ
33 20106݄3༵ -
Smalltalkษڧձ - Iliad ϑϩʔ੍ޚ 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 34 20106݄3༵ -
Smalltalkษڧձ - Iliad ϑϩʔ੍ޚ(Seaside) WATask>>goͰϑϩʔશମΛهड़ MyLoginComponent MyUserRegisterComponent MyMainComponent MyTask call:
answer: ೝূࣦഊ ೝূޭ ॊೈͳϑϩʔ੍ޚ͕هड़Մೳ 35 20106݄3༵ -
Smalltalkษڧձ - Iliad ϑϩʔ੍ޚ MyIliad-Login.st ControllerͰ͋ΔILApplicationͰϑϩʔΛཧ ҰൠతͳWeb Frameworkͱಉ༷ͳߟ͑ํ Ruby on
Rails, Zend Framework MyIliad-Login.stΛfile inͯ֬͠ೝ͍ͯͩ͘͠͞ 36 20106݄3༵ -
Smalltalkษڧձ - Iliad ϑϩʔ੍ޚ(Iliad - 1) ILApplication subclass: #MyFlowApplication !
instanceVariableNames: 'flow' ! classVariableNames: '' ! poolDictionaries: '' ! category: 'MyIliad-Login' MyIliad-Login.st index ! ^ [:e | ! ! e build: self flow.] login ! flow := MyLoginWidget new main ! flow := MyMainWidget new. register ! flow := MyUserRegisterWidget new. flow ! ^ flow ifNil:[ flow := MyLoginWidget new ] flow: anObject ! flow := anObject ίϯτϩʔϥ͕ࢠཁૉʢWidgetʣΛஔ͖͑Δ 37 20106݄3༵ -
Smalltalkษڧձ - Iliad ϑϩʔ੍ޚ(Iliad - 2) ILWidget subclass: #MyLoginWidget !
instanceVariableNames: 'user' ! classVariableNames: '' ! poolDictionaries: '' ! category: 'MyIliad-Login' login ! ((user user = 'admin') and:[ user password = 'admin']) ! ! ifTrue:[ self application main. ] ! ! ifFalse:[ ! ! ! self application register. ]. MyIliad-Login.st ίϯτϩʔϥʹͤΔ contents ^[:e | e form build: [:form | form text:'User ID'. form input action:[:v | user user: v. ]. form text:'Password'. form password action:[:v | user password: v. ]. form button text: 'create'; action: [ self login ]]] 38 20106݄3༵ -
Smalltalkษڧձ - Iliad ϑϩʔ੍ޚ(Iliad - 3) ILWidget subclass: #MyUserRegisterWidget !
instanceVariableNames: 'user' ! classVariableNames: '' ! poolDictionaries: '' ! category: 'MyIliad-Login' addUser ! "͜͜ʹϢʔβՃॲཧ" ! self application main. MyIliad-Login.st contents ^[:e | e form build: [:form | form text:'User ID'. form input action:[:v | user user: v. ]. form text:'Password'. form password action:[:v | user password: v. ]. form button text: 'create'; action: [ self addUser ]]] ίϯτϩʔϥʹͤΔ 39 20106݄3༵ -
Smalltalkษڧձ - Iliad Session >>(class) initialize app := MyTask registerAsApplication:
'myTask'. app preferenceAt: #sessionClass put: MySession. WASessionͷαϒΫϥεΛ࡞ WAComponent subclass 43 20106݄3༵ -
Smalltalkษڧձ - Iliad Response (2) respondOn: aResponse aResponse contentType:'text/xml'; contents:
self svg. ILApplication subclass MySVGApplication.st self svg SVGͷςΩετΛฦ͢ϝιου respondOn:ΛΦʔόϥΠυ͢Δ 45 20106݄3༵ -
Smalltalkษڧձ - Iliad Response (3) 2.8ܥ renderContentOn:html self session returnResponse:
(WAResponse new !! contentType: 'text/xml'; ! ! nextPutAll: self makeSVG; ! ! yourself) WAComponent subclass 46 20106݄3༵ -
Smalltalkษڧձ - Iliad Response (4) renderContentOn: html ! self requestContext
respond: [:response | ! ! response ! ! initializeOn: self svg ; contentType: 'text/xml'] 3.0ܥ WAComponent subclass 47 20106݄3༵ -
Smalltalkษڧձ - Iliad ։ൃڥ ϒϥβ্Ͱͷ ։ൃ ຊޠ Documents গͳ͍ ଟ͍
49 20106݄3༵ -
Smalltalkษڧձ - Iliad ຊޠͷରԠํ๏ കᖒ͞ΜΑΓຊޠԽύονఏڙ ʢPharoͰར༻Մೳʣ GRUtf8SqCodec.st ILSite default codec:
(GRUtf8SqCodec new). GRUtf8SqCodec.st Λfile in͢Δ WorkspaceͰҎԼͷίʔυΛdo it 51 20106݄3༵ -
Smalltalkษڧձ - Iliad ରԠSmalltalk Squeak Pharo VisualWorks GNU Smalltalk GemStone
Dolphin Smalltalk VASmalltalk Squeak Pharo GNU Smalltalk VisualWorksʢରԠ༧ఆʣ 52 20106݄3༵ -
Smalltalkษڧձ - Iliad ࢀߟใ • Iliad http://www.iliadproject.org/index • Seaside http://www.seaside.st/
• GNU Smalltalk http://smalltalk.gnu.org/ Iliad ϝʔϦϯάϦετ http://groups.google.fr/group/iliad 54 20106݄3༵