18
Play! Together Play! Together What are you going to play? What are you going to play?

play framework 勉強会 in 関西

Embed Size (px)

Citation preview

Page 1: play framework 勉強会 in 関西

Play! TogetherPlay! TogetherWhat are you going to play?What are you going to play?

Page 2: play framework 勉強会 in 関西

2 | Internal use only

WhoWho??

TwitterID : s_kozake

Page 3: play framework 勉強会 in 関西

3 | Internal use only

・「 Ruby on Rails 」と「 Django 」の影響を強く受けた Java による MVC フレームワーク

・ zenexity 社の guillaume bort が開発者の生産性向上を目的として作成

・ 2009 年 10 月に 1.0 版がリリース

・ 2010 年 11 月にリリースされた 1.1 版からは Scala のサポートも始まった

・ 2011 年 04 月にリリースされた 1.2 版からは、 Apache Ivy による依存性管理

と WebSockets のサポート。あと、 DB 管理まわり。

・ 2011 年 05 月にリリースされた 1.2.2 版が最新。

ちなみにこの方

What' Play framework?What' Play framework?

Page 4: play framework 勉強会 in 関西

4 | Internal use only

Play moviePlay movie

Page 5: play framework 勉強会 in 関西

5 | Internal use only

Feature of Play frameworkFeature of Play framework

Page 6: play framework 勉強会 in 関西

6 | Internal use only

Feature of Play framework Feature of Play framework ~~ Play is MVC application architecture modelPlay is MVC application architecture model ~~

MVC application architecture modelMVC application architecture model Request life cycleRequest life cycle

Page 7: play framework 勉強会 in 関西

7 | Internal use only

Feature of Play frameworkFeature of Play framework~~ Play is Full Stack FrameworkPlay is Full Stack Framework ~~

・環境設定不要・・・ダウンロードして、解凍するだけ

・デプロイ不要・・・ Web アプリケーションサーバへの配置不要。コードを書いて、ブラウザの更新ボタンを押すだけ

・テスト環境サポート・・・ Junit と Selenium による簡易なテスト環境

・ IDE サポート・・・ Netbeans, IntelliJ IDEA と Eclipse プラットフォームをサポート

            play netbeansify myapp            play eclipsify myapp            play idealize myapp

・デプロイ・・・スタンドアローン、アプリケーションサーバ、 GAE 、 Stax クラウドホスティングプラットフォーム

・ Not based on Servlet ・・・ Play はサーブレット上で動きません。完全な独自実装な Web フレームワークです。

Page 8: play framework 勉強会 in 関西

8 | Internal use only

Feature of Play frameworkFeature of Play framework~~ Play is StatelessPlay is Stateless ~~

Shared Nothing アーキテクチャ。 Servlet でいうところの Session は使わない。

⇒ 複数リクエストをまたいでデータを保持する場合は?

⇒( データベースのような ) 永続ストレージに、データを恒久的に保存

データが小さくて、十分に簡単である場合は、 Session か Flash スコープ

スコープには cookie を使用する為、保存できるデータは 4KB 制限かつ String 型のデータのみ  ・ Flash ・・・・・・・・・次のリクエストにおいてのみ利用可能

 ・ Session ・・・・・・ユーザセッションにおける全ての間で利用可能

⇒( キャッシュのような ) 一時的なストレージに、データを一時的に保存

Memcached をサポート!

ただし、 Memcached を設定しない場合、 JVM ヒープにデータを保存するスタンドアロンキャッシュを使用 する。

Page 9: play framework 勉強会 in 関西

9 | Internal use only

Feature of Play frameworkFeature of Play framework~~ Play have a lot of APIPlay have a lot of API ~~豊富な API を用意。開発者が望むサードパーティーライブラリはほとんど最初から用意されている

Jar ファイル

Codec: データをエンコードまたはデコードするユーティ

リティ

Crypto: 暗号化に関するユーティリティ

Expression: 動的な式の評価

F: Java による関数プログラミング

ファイル : ファイルシステム操作ヘルパ

I18N: 国際化ヘルパ

IO: ストリーム操作ヘルパ

Images: イメージ操作ヘルパ

Mail: e メール関数

MimeTypes: MIME タイプの取扱い

OAuth: OAuth クライアントプロトコル

OAuth2: OAuth2 クライアントプロトコル

OpenID: OpenID クライアントプロトコル

Time: 時間と期間のユーティリティ

WS: 強力な Web サービスクライアント

XML: XML 構造のロード

XPath: XPath による XML の解析

Play ライブラリ

Page 10: play framework 勉強会 in 関西

10 | Internal use only

Feature of Play frameworkFeature of Play framework ~ ~ OtherOther ~~

・非同期 I/O ・・・長時間ポーリング、ストリーミング、そしてその他の Comet スタイル

 のアプリケーションを達成するための非同期処理が用意されている

・モジュールアーキテクチャ: Rails や Django のように、 Play はモジュールの概念をサポート。

これにより、コアを簡単かつエレガントに拡張可能

Page 11: play framework 勉強会 in 関西

11 | Internal use only

Architecture of Play Architecture of Play frameworkframework

Page 12: play framework 勉強会 in 関西

12 | Internal use only

Architecture of Play framework Architecture of Play framework ~~ Application layout Application layout ~~

・・・コントローラの Java ソース

・・・モデルの Java ソース

・・・ view の html ソース

・・・アプリケーションのための主な構成ファイルです。標準的な構成オプションを含む

・・・依存性管理のファイル

・・・国際化リソースファイル

・・・ルーティングを定義するファイル

・・・ Web サーバによって直接配信される静的なリソース

・・・ Java ライブラリ用ディレクトリ。自動的に Java クラスパスに追加される。

・・・テストソース用ディレクトリ

・・・バイトコードキャッシュとしてコンパイルされたクラスを保持するディレ

クトリ

Page 13: play framework 勉強会 in 関西

13 | Internal use only

Feature of Play frameworkFeature of Play framework ~ ~ OtherOther ~~

・ Web サーバとして、 JBoss Netty を使用

・データベースレイヤーに Hibernate を使用

・ View のテンプレートエンジンに Groovy を使用

・ホットリローディングとして Eclipse コンパイラを使用

・依存性管理に Apache Ivy を使用

Page 14: play framework 勉強会 in 関西

14 | Internal use only

Play samplePlay sample ~ ~ Yet Another Blog EngineYet Another Blog Engine ~~Play ガイド チュートリアルで作成するアプリケーションの完成形

Page 15: play framework 勉強会 in 関西

15 | Internal use only

Play samplePlay sample ~ ~ OtherOther ~~

Zencontact ・・・簡単な連絡先管理アプリケーション

Booking ・・・よく知られている JBoss seam フレームワークの ‘ booking’ アプリケーションのポーティング

Forum ・・・ JPA を使用する簡単なフォーラムアプリケーション

Jobboard ・・・ CRUD モジュールを使用して管理画面を自動生成するフル機能のジョブボードアプリケーション

Chat ・・・ HTTP ベースのチャットアプリケーション。リソースを浪費せずに多くの同時接続ユーザを

      扱うことができるよう、 非同期リクエストモデルを使用。

Validation ・・・バリデーションがサポートされたフォームを作成する様々な方法を実演

twitter-oauth ・・・ OAuth 1.0 を使用した Twitter との連携サンプル

facebook-oauth2 ・・・ OAuth 2.0 を使用した Facebook との連携サンプル

Page 16: play framework 勉強会 in 関西

16 | Internal use only

Learn moreLearn more

日本 Playframework ユーザー会

日本語翻訳サイト

本家本元

UMEZAWA, Yuichiro ( @garbagetown ) さん

Ikeda Takafumi ( @ikeike443 ) さんありがとうございます!

http://www.playframework.org/

http://playdocja.appspot.com/

https://groups.google.com/group/play_ja/topics

Page 17: play framework 勉強会 in 関西

Play still has a lot of functions.

I want to do hackathon some time.

Let‘s Play!

Let’s Play!Let’s Play!

Page 18: play framework 勉強会 in 関西

play new framework