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
460
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
290
RubyとRubyKaigiがきっかけで沖縄から東京に転職した話/TokyuRubyKaigi2018
yono
2
4.1k
Rails経験者が万葉の新人研修を受けて得られたこと/railsdm2018_day3_extreme
yono
2
5.1k
レガシーRailsアプリとの付き合い方について考える
yono
2
430
Other Decks in Technology
See All in Technology
全部AI、全員Cursor、ドキュメント駆動開発 〜DevinやGeminiも添えて〜
rinchsan
6
3.4k
united airlines ™®️ USA Contact Numbers: Complete 2025 Support Guide
flyunitedhelp
1
470
Introduction to Bill One Development Engineer
sansan33
PRO
0
260
american airlines®️ USA Contact Numbers: Complete 2025 Support Guide
supportflight
1
120
Enhancing SaaS Product Reliability and Release Velocity through Optimized Testing Approach
ropqa
1
260
Amazon SNSサブスクリプションの誤解除を防ぐ
y_sakata
3
130
[ JAWS-UG千葉支部 x 彩の国埼玉支部 ]ムダ遣い卒業!FinOpsで始めるAWSコスト最適化の第一歩
sh_fk2
2
150
VS CodeとGitHub Copilotで爆速開発!アップデートの波に乗るおさらい会 / Rapid Development with VS Code and GitHub Copilot: Catch the Latest Wave
yamachu
2
390
第64回コンピュータビジョン勉強会「The PanAf-FGBG Dataset: Understanding the Impact of Backgrounds in Wildlife Behaviour Recognition」
x_ttyszk
0
230
20250708オープンエンドな探索と知識発見
sakana_ai
PRO
4
960
オフィスビルを監視しよう:フィジカル×デジタルにまたがるSLI/SLO設計と運用の難しさ / Monitoring Office Buildings: The Challenge of Physical-Digital SLI/SLO Design & Operation
bitkey
1
370
Reach American Airlines®️ Instantly: 19 Calling Methods for Fast Support in the USA
flyamerican
1
180
Featured
See All Featured
Why Our Code Smells
bkeepers
PRO
336
57k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.9k
4 Signs Your Business is Dying
shpigford
184
22k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
Docker and Python
trallard
45
3.5k
Speed Design
sergeychernyshev
32
1k
Making the Leap to Tech Lead
cromwellryan
134
9.4k
The Art of Programming - Codeland 2020
erikaheidi
54
13k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.1k
Gamification - CAS2011
davidbonilla
81
5.4k
Raft: Consensus for Rubyists
vanstee
140
7k
A Modern Web Designer's Workflow
chriscoyier
695
190k
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