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
480
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.3k
Rails経験者が万葉の新人研修を受けて得られたこと/railsdm2018_day3_extreme
yono
2
5.3k
レガシーRailsアプリとの付き合い方について考える
yono
2
450
Other Decks in Technology
See All in Technology
10Xにおける品質保証活動の全体像と改善 #no_more_wait_for_test
nihonbuson
PRO
2
310
Frontier Agents (Kiro autonomous agent / AWS Security Agent / AWS DevOps Agent) の紹介
msysh
3
180
ブロックテーマ、WordPress でウェブサイトをつくるということ / 2026.02.07 Gifu WordPress Meetup
torounit
0
190
OWASP Top 10:2025 リリースと 少しの日本語化にまつわる裏話
okdt
PRO
3
800
Agile Leadership Summit Keynote 2026
m_seki
1
630
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
3.9k
Ruby版 JSXのRuxが気になる
sansantech
PRO
0
160
What happened to RubyGems and what can we learn?
mikemcquaid
0
300
こんなところでも(地味に)活躍するImage Modeさんを知ってるかい?- Image Mode for OpenShift -
tsukaman
0
140
GitHub Issue Templates + Coding Agentで簡単みんなでIaC/Easy IaC for Everyone with GitHub Issue Templates + Coding Agent
aeonpeople
1
240
Oracle Cloud Observability and Management Platform - OCI 運用監視サービス概要 -
oracle4engineer
PRO
2
14k
超初心者からでも大丈夫!オープンソース半導体の楽しみ方〜今こそ!オレオレチップをつくろう〜
keropiyo
0
110
Featured
See All Featured
Become a Pro
speakerdeck
PRO
31
5.8k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
450
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
270
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
210
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
66
37k
Testing 201, or: Great Expectations
jmmastey
46
8k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
78
Paper Plane (Part 1)
katiecoart
PRO
0
4.3k
[SF Ruby Conf 2025] Rails X
palkan
1
760
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
590
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
130
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