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

RUNNING Smalltalk - 実践Smalltalk

RUNNING Smalltalk - 実践Smalltalk

第75Smalltalk勉強会の資料(http://www.smalltalk-users.jp/Home/gao-zhi/dai75kaismalltalkbenkyoukai) クラウドとSmalltalkで日本発の世界向けサービスを始める方法
中古建設機械販売検索サービス https://allstocker.com の話です。

newapplesho

April 28, 2015
Tweet

More Decks by newapplesho

Other Decks in Programming

Transcript

  1. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. ஌Βͳ͍ํͷͨΊʹ

    RUNNING LEAN ΞογϡɾϚ΢Ϧϟ (ஶ), ౉ล ઍլ (ղઆ) ग़൛ ΦϥΠϦʔɾδϟύϯ
  2. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. ϓϩϑΟʔϧ

    • ٢ా ᠳʢΑͩ͠͠ΐ͏ʣ • 1986೥ੜ·Ε • Smalltalker twitter: @newapplesho facebook: newapplesho
  3. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. Smalltalkͷਓʹ

    ͳͬͯଞͷݴޠ͕ Ͱ͖ͳ͘ͳͬͨ Smalltalkେ޷͖ͬͯݴ͍͗ͨ͢Β PHP΍ΔΜͰ͢Ͷɾɾɾɻ Ruby΍ΔΜͰ͢Ͷɾɾɾɻ Java΍ΔΜͰ͢Ͷɾɾɾɻ
  4. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. Smalltalkͬͯ࠷ߴͰ͢Ͷ

    http://www.softumeya.com/pyonkee/ja/ ΞϓϦͩͬͯϦϦʔε͞Ε͍ͯΔ
  5. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. Smalltalkͬͯ࠷ߴͰ͢Ͷ

    https://www.kickstarter.com/projects/1520902870/canadian-smalltalk-competition Smalltalk is a revolutionary language that has the power to transform the future of software development.
  6. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. Henry

    Burrows https://www.flickr.com/photos/foilman/8015746124/ Ͳ͜Ͱ࢖ΘΕ͍ͯΔͷʁ ͑ʂ ͋Δษڧձͷ࠙਌ձͰͷग़དྷࣄ
  7. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. ݐઃػցɾॏػɾं྆ͷྲྀ௨Λ

    ࢧ͑ΔϓϥοτϑΥʔϜ Mikata https://mikatacloud.com 2014೥9݄Ұൠެ։
  8. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. ϝσΟΞʹܝࡌ͞Ε·ͨ͠

    2015೥01݄12೔ͷ೔ܦܦࡁ৽ฉ ேץͷ৽ڵதখاۀཝ
  9. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. Henry

    Burrows https://www.flickr.com/photos/foilman/8015746124/ SmalltalkͳΜͩͬͯ ͦ͏ͳΜͩ
  10. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. ͨͩ୭Ͱ΋ࢀՃͰ͖ΔΘ͚Ͱ͸ͳ͍

    ؆୯ʹ͍͏ͱ ΫϩʔζυͳதݹചങαʔϏε ʢݐઃػցϨϯλϧձࣾͱ๵қձࣾઐ༻ʣ Mikata άϧʔϓ΢ΣΞʹ͍ۙαʔϏε
  11. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. ALLSTOCKER

    ੈքதͷݐઃػցͷΦϯϥΠϯϚʔέοτϓϨΠε 2015೥2݄຤ ৽͍͠αʔϏεΛ࢝Ί·ͨ͠ https://allstocker.com
  12. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. ALLSTOCKER

    ੈքதͷݐઃػցͷΦϯϥΠϯϚʔέοτϓϨΠε ܦࡁ࢈ۀল ʮઌ୺՝୊ରԠܕϕϯνϟʔࣄۀԽࢧԉ౳ࣄۀʯʹ࠾୒
  13. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. Henry

    Burrows https://www.flickr.com/photos/foilman/8015746124/ ͖ͬͱSmalltalkͩΑ ͩΑͶ
  14. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. Henry

    Burrows https://www.flickr.com/photos/foilman/8015746124/ ̍िؒͰ࡞ͬͯͶ ͑ اըΛؚΊͯ̎िؒͰ࡞Βͳ͚Ε͹ͳΒͳ͔ͬͨ
  15. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. Ͳ͏࡞Δ͔

    • αʔϏεͷ֦େʹ߹ΘͤͯεέʔϧͰ͖ΔΫϥ΢υαʔ όʔΛར༻ • SmalltalkͷμΠφϛοΫͳ։ൃೳྗΛར༻͢Δ • ػցຖʹҟͳΔ৘ใΛอଘ͢ΔͨΊNoSQLΛ׆༻ • ࣸਅ͸ΦϦδφϧϑΝΠϧ͚ͩΛอଘ Mikataͷϊ΢ϋ΢Λϕʔεʹ։ൃ ৄ͘͠͸ୈ68ճSmalltalkษڧձͷࢿྉʹͯ
  16. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. ར༻͍ͯ͠ΔαʔϏε

    • EC2ʢԾ૝αʔόʔʣ • ELBʢϩʔυόϥϯαʔʣ • Route53ʢDNSʣ • Amazon RDS for PostgreSQLʢRDBʣ • Amazon DynamoDBʢNoSQLʣ • S3ʢࣸਅɼϩά౳ͷετϨʔδʣ
  17. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. Region

    Availability Zone Availability Zone PostgreSQL PostgreSQL RDS PostgreSQL PostgreSQL PostgreSQL RDS PostgreSQL DynamoDB S3 Amazon EC2 Amazon EC2 Internet Amazon Route 53 Hosted Zone Elastic Load Balancing 44- 44- 44- 44- ߏ੒ਤ
  18. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. Allstocker

    Λࢧ͑ΔSmalltalk ։ൃݴޠ Smalltalk(Pharo 3.0) Web Framework Seaside 3.1 + mushtache RDB Glorp(PostgreSQL) ϩά Nagare(Fluentd) NoSQL AWS SDK for Smalltalk
  19. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. AWS

    SDK for SmalltalkͷΠϯετʔϧ Gofer new url:'http://smalltalkhub.com/mc/newapplesho/aws-sdk-smalltalk/main'; package: 'ConfigurationOfAWS'; load. (Smalltalk at: #ConfigurationOfAWS) load. αʔϏεͰ࢖͑͹ɺϝϯςφϯε΋͞ΕΔ͸ͣ
  20. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. Allstocker

    ΛCSS Framework SeasideͷBoostrapύοέʔδ͸࢖Θͳ͍ Allstocker Mikata ಠࣗͷCSS Framework
  21. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. ͦͷଞ

    • ը૾΍CSS͸֎෦urlࢀর • ϝʔϧૹ৴͸UTF8ඇରԠΫϥΠΞϯτ΋͋ΔͨΊRubyʹ ೚ͤΔ • ϝʔϧΛૹ৴͸SendGridΛ׆༻ • ը૾Ξοϓϩʔυ΍ϦαΠζ͸Nginxʹ೚ͤΔʢSmalltalkͰ ॲཧ͠ͳ͍ʣ
  22. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. SeasideͷσβΠϯ൓өϓϩηε

    ϞοΫ ࡞੒ ϨϏϡʔ Seaside ϦϦʔε HTMLΛSmalltalkʹม׵͢Δ࡞ۀ ඇৗʹେม
  23. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. Mustache

    {{^isLoggedIn}} <p> <a href="{{baseUrl}}signup" class="btn btn-small btn-green">৽نձһొ࿥(ແྉ)</a> <a href="{{baseUrl}}login" class="btn btn-small btn-blue">ϩάΠϯ</a> </p> {{/isLoggedIn}}
  24. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. MustacheͷΠϯετʔϧ

    Gofer it url: 'http://mc.stfx.eu/Neo'; package: 'Neo-JSON-Core'; load. Gofer it smalltalkhubUser: 'NorbertHartl' project: 'Mustache'; configurationOf: 'Mustache'; loadStable.
  25. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. Mustacheͷར༻

    value := Dictionary new. value at:'isLoggedIn' put: self session isLoggedIn. "ςϯϓϨʔτ΁ͷద༻" result := (MustacheTemplate on: templateString) value: value.
  26. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. GettextΛར༻

    http://smalltalkhub.com/#!/~PharoExtras/Gettext/ ConfigurationOfGettext load. http://www.gnu.org/software/gettext/ gettext gettext͸ࠃࡍԽͱ஍ҬԽʹରԠ͢ΔϥΠϒϥϦߏ੒ཁૉͷҰͭͰ͋Γɺ༷ʑͳ஍Ҭͷ ݴޠʹରԠͨ͠஍ҬԽιϑτ΢ΣΞΛ։ൃ͢Δࡍʹ༻͍ΒΕΔɻ(WikipediaΑΓ) Pharoͷ֦ுػೳ ύοέʔδͷϩʔυ
  27. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. SeasideͰGettextΛ࢖͏ͨΊʹ

    StringΫϥεʹϩʔΧϧID(ja, en)Λࢦఆͯ͠ ຋༁͢ΔͨΊͷmethodΛ༻ҙ͢Δ String >> mtranslatedTo: `)FMMP`NUSBOTMBUFE5P`KB` `͜Μʹͪ͸` ׬੒Πϝʔδ
  28. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. Gettextͷར༻ํ๏

    GetTextExporter exportTemplateIncluding:#mtranslatedTo:. TextDomainManager registerCategoryPrefix: 'Mikata-Asia' domain: 'Mikata'. ઃఆ ςϯϓϨʔτϑΝΠϧ(potϑΝΠϧ)Λग़ྗ #mtranslatedTo: Λૹͬͨϝοηʔδ΋ςϯϓϨʔτʹग़ྗ͞ΕΔ
  29. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. Gettextͷར༻ํ๏

    pot ja.po en.po en.mo ja.mo poΤσΟλʔͳͲͰ຋༁ ςϯϓϨʔτ όΠφϦϑΝΠϧ PharoʹಡΈࠐΉ Pharo
  30. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. Gettextͷར༻ํ๏

    GetTextTranslator reset. όΠφϦϑΝΠϧͷಡΈࠐΈ locale/<localID>/LC_MESSAGES/Mikata.mo όΠφϦϑΝΠϧͷ഑ஔ XX.app/Contents/Resources/locale/ja/LC_MESSAGES/Mikata.mo ྫ
  31. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. Gettextͷར༻ํ๏

    String>> mtranslatedTo: isoString ^ (GetTextTranslator availableForLocaleID: (LocaleID isoString: isoString) ) translate: self inDomain: 'Mikata'. StringΫϥεͷ֦ு
  32. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. Seasideͷηογϣϯ؅ཧͷઃఆ

    app := (WAAdmin register: self asApplicationAt:'app') preferenceAt: #sessionClass put: MASession; yourself. app preferenceAt: #trackingStrategy put: WACookieForBrowserIPForCrawlerTrackingStrategy new. ެ։λΠϓͰݕࡧػೳ͕͋ΔΑ͏ͳαΠτͷ৔߹͸ ্هͷΑ͏ʹ͢ΔͱΑ͍ botʹηογϣϯރׇΛ͞Εͳ͍Α͏ʹ͢Δ
  33. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. ύʔϚϦϯΫ

    https://allstocker.com/app/ja/machinery/dozer/539fffd185674bec813be5228d25d306
  34. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. ύʔϚϦϯΫ

    • Mikataͱҧ͍ɺΦʔϓϯͳγεςϜͳͷͰURL͸ඇৗʹ ॏཁʹͳͬͯ͘Δ • SeasideΒ͠͞͸ࣦΘΕͭͭ͋ΔʢΉ͠Ζผͷ͕͍ ͍ɾɾɾίιʣ
  35. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. ιʔείʔυ؅ཧ

    • Metacello + FileTree͔ͭGitΛ࢖ͬͯ؅ཧ • ConfigurationOfMikataA Λ࡞ΓSmalltalk HubͳͲ͔Β AllstockerʹඞཁͳύοέʔδΛinstallՄೳʹ͢Δ • BaselineOfΛܧঝͨ͠BaselineOfMikataAͱ࡞੒͠ɺ ϩʔΧϧͷGitϦϙδτϦ͔ΒAllstockerͷίʔυΛಡΈ ࠐΉ
  36. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. ιʔείʔυ؅ཧ

    Smalltalker Git Smalltalker Git pull request pull
  37. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. σϓϩΠ

    Amazon EC2 Instance S3 S3ʢετϨʔδαʔϏεʣ͔ΒEC2ʹσϓϩΠ ໿̍೔̍ճͷϖʔεͰϦϦʔε
  38. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. Allstocker

    • ๛෋ͳ඼਺ • ۀքʹ͸ͳ͔ͬͨॆ࣮ͳػೳ • ҆৺ɾ҆શͳऔҾͷ࣮ݱ ΋ͬͱ΋ॏ͍ͨ΋ͷΛѻ͏ϕϯνϟʔ
  39. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. ࠓޙ΍Γ͍ͨ͜ͱ

    • Τοδϩέʔγϣϯͷར༻ • શจݕࡧ • ϩάղੳ • Web Frameworkͷݟ௚͠ • ϞόΠϧΞϓϦରԠ • Angular.jsͷಋೖ
  40. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. શจݕࡧʹ͍ͭͯ

    • RDS(PostgreSQL)͸೔ຊޠશจݕࡧΛαϙʔτ͍ͯ͠ͳ ͍ • શจݕࡧΛରԠ͢ΔͨΊʹElasticSearchΛಋೖ༧ఆ GitHubͱ͔ʹ࢖ΘΕ͍ͯΔΒ͍͠Ͱ͢
  41. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. ϩάղੳ

    • ݱࡏfluentd(Nagare)Λ࢖ͬͯϩά͸ऩू͍ͯ͠Δ͕ɺΤϥʔҎ֎ ͸׆༻Ͱ͖͍ͯͳ͍ • KibanaʹΑΓϝϯόʔશһ͕؆୯ʹϢʔβʔͷ෼ੳΛ೺ѲͰ͖ ΔΑ͏ʹ͢Δ
  42. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. Web

    Frameworkͷݟ௚͠ • ܧଓͰ͋ΔͨΊAPؒͷηογϣϯͷڞ༗Խ͕೉͍͠ • ܧଓΛ࢖͍ͨͯ͘΋࢖͑ͳ͍ͱ͖͕ଟ͘ͳ͖ͬͯͨ • ͍ͩͿݹ͘ͳ͍ͬͯΔʢಛʹCanvasपΓʣ • ը໘पΓͷࣗಈςετ͕೉͍͠ ܰྔ͔ͭStateless Web Framework͕ཉ͍͠
  43. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. DB·ΘΓͳΜͱ͔͍ͨ͠

    • PostgreSQLͷυϥΠόʔ͕ݹ͗͢Δ • O/RϚοϐϯά͕ۤߦʢΠέ͍ͯͳ͍ʣ • ϚΠάϨʔγϣϯ͕େม
  44. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. CI؀ڥͷߏங

    Git ̍೔ͷՁ஋ఏڙͷճ਺Λ૿΍͍ͨ͠ PharoຊՈͰ΍͍ͬͯΔ͚Ͳ Ͳ͏΍ΔΜͰ͠ΐ͏͔
  45. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. Henry

    Burrows https://www.flickr.com/photos/foilman/8015746124/ SmalltalkͩΑͶ ͩΑͶ
  46. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. Smalltalk͸

    ֶशίετ͕ ௿͍ݴޠͰ͢ ଞݴޠͷϢʔβʔ΋׻ܴͰ͢
  47. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. ืू৬छ

    • Smalltalker • ϓϩάϥϚʔ • ϞόΠϧΞϓϦέʔγϣϯΤϯδχΞ • σβΠφʔ • ΠϯϑϥΤϯδχΞ
  48. Copyright © 2015 SORABITO Co., Ltd. All Rights Reserved. ͜Μͳํ୳͍ͯ͠·͢

    • ౦ೆΞδΞͷࣗવݴޠ͕Ͱ͖ΔΤϯδχΞ • UI/UXʹৄ͍͠ํ • ηΩϡϦςΟ໘Ͱ஌ࣝͷ͋Δํ • AllstockerͷϚʔςΟϯά౳Λ΍ͬͯΈ͍ͨํ