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
Play! framework について
Search
Yusaku ONO
November 12, 2011
Technology
1
470
Play! framework について
2011/11/11 第27回はごー勉強会の発表資料です
Yusaku ONO
November 12, 2011
Tweet
Share
More Decks by Yusaku ONO
See All by Yusaku ONO
Rubyで日常をちょっとだけたのしくする / Rails Girls Okinawa 1st
yono
0
300
RubyとRubyKaigiがきっかけで沖縄から東京に転職した話/TokyuRubyKaigi2018
yono
2
4.2k
Rails経験者が万葉の新人研修を受けて得られたこと/railsdm2018_day3_extreme
yono
2
5.2k
レガシーRailsアプリとの付き合い方について考える
yono
2
440
Other Decks in Technology
See All in Technology
OCI Network Firewall 概要
oracle4engineer
PRO
1
7.8k
実装で解き明かす並行処理の歴史
zozotech
PRO
1
420
LLMアプリケーション開発におけるセキュリティリスクと対策 / LLM Application Security
flatt_security
7
1.9k
組織観点からIAM Identity CenterとIAMの設計を考える
nrinetcom
PRO
1
180
Trust as Infrastructure
bcantrill
0
340
Exadata Database Service on Dedicated Infrastructure(ExaDB-D) UI スクリーン・キャプチャ集
oracle4engineer
PRO
2
5.4k
研究開発部メンバーの働き⽅ / Sansan R&D Profile
sansan33
PRO
3
20k
PLaMoの事後学習を支える技術 / PFN LLMセミナー
pfn
PRO
9
3.9k
OpenAI gpt-oss ファインチューニング入門
kmotohas
2
1k
AI駆動開発を推進するためにサービス開発チームで 取り組んでいること
noayaoshiro
0
190
Oracle Cloud Infrastructure:2025年9月度サービス・アップデート
oracle4engineer
PRO
0
450
PLaMo2シリーズのvLLM実装 / PFN LLM セミナー
pfn
PRO
2
990
Featured
See All Featured
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
6.1k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Learning to Love Humans: Emotional Interface Design
aarron
274
40k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.1k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
188
55k
Build your cross-platform service in a week with App Engine
jlugia
232
18k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
30
2.9k
Scaling GitHub
holman
463
140k
How GitHub (no longer) Works
holman
315
140k
Automating Front-end Workflow
addyosmani
1371
200k
Transcript
Play framework について ⼩野 裕作
None
Java
Servelet, JSP を使わない XML を使わない コンパイル不要 設定不要 Eclipse 不要
Ruby on Rails Like
MVC フルスタック コマンドで雛形を⽣成 ディレクトリ構成 ソースコードの修正を即座に反映 テストフレームワークが付属
http://www.playframework.org/
Install
$ wget http://download.playframework.org/releases/play-1.2.3.zip $ unzip play-1.2.3.zip $ export PATH=$PATH:[Playのディレクトリ]
$ export PATH=$PATH:/var/lib/play-1.2.3
Start development
$ play new [プロジェクト名]
$ play new helloworld
$ cd helloworld
app - ソースコード conf - 設定ファイル public - 静的ファイル(CSS, JavaScript,
Image など) test - テスト⽤コード lib - 外部ライブラリ modules - Play! ⽤モジュール logs - ログ tmp - class ファイルなど test-result - テスト結果
Run a app
$ play run
http://localhost:9000
Test
$ play test
http://localhost:9000/@tests
$ play auto-test
Coverage
$ play install cobertura $ vim conf/dependencies.yml # Application dependencies
require: - play -> cobertura 2.4 $ play dependencies --forceCopy
$ play auto-test $ open test-result/code-coverage/index.html
Other
$ play help
http://localhost:9000/@documentation
Eclipse
$ play eclipsify $ cp $PLAY_INSTALLED_DIR/support/eclipse/org.playframework.playclipse_0.7.0.ja $ECLIPSE/dropins/
Scaffold
Rails との違い 標準機能ではない(モジュール) Model は⼿動で作成 Model を基に Controller, View を⽣成
login 処理を⽣成
$ play install scaffold
$ vim conf/dependencies.yml # Application dependencies require: - play ->
scaffold 0.1 - play -> secure
$ play dependencies --forceCopy
--forceCopy の有無 有: play のインストールディレクトリ以下に配置 無: プロジェクト以下に配置
$ vim conf/application.conf $ db=mem
Model を⽤意する チュートリアルの Model User.java Post.java Comment.java Tag.java
None
$ play scaffold:gen --with-layout --with-login --overwrite
$ play scaffold:gen --with-layout --with-login --overwrite
http://play-scaffold.herokuapp.com/
Deploy apps to heroku
$ vim Procfile web: play run --http.port=$PORT $PLAY_OPTS
$ vim .gitignore /lib /tmp /modules /test-result /logs /eclipse
$ git init $ git add . $ git commit
-m 'first commit'
$ heroku create --stack cedar
$ git push heroku master
DB: PostgreSQL conf/application.conf を変更 User クラスはテーブル名を変えておく
まとめ Java らしくない Java Web Framework RoR Like で⾼速な開発 heroku
対応で簡単なデプロイ
None
Play Scala http://playscala.appspot.com
$ play install scala $ play new helloscala --with scala
None