...

S2Pradoの紹介 S2Pradoの紹介

by user

on
Category: Documents
4

views

Report

Comments

Transcript

S2Pradoの紹介 S2Pradoの紹介
Seasar Conference
2007 Autumn
S2Pradoの紹介
S2Prado
の紹介
S2Container.PHP5と連携した
S2Container
PHP5と連携した
PRADOアプリケーションの構築
植山 能成
Seasar Conference
2007 Autumn
© The Seasar Foundation and the others 2007. all rights reserved.
⾃⼰紹介
•
•
•
•
•
丙午・クリスマスイヴうまれの40才
福岡県福岡市在住
株式会社アイティー勤務
主業務:通信系システム開発 (SIP,P2P)
(SIP P2P)
業務でのPHP開発経験 約半年
Seasar Conference
2007 Autumn
© The Seasar Foundation and the others 2007. all rights reserved.
⽬次
•
•
•
•
•
PRADO Frameworkとは
デモその1
S2Prado.PHP5とは
デモその2
PRADOプロジェクト
Seasar Conference
2007 Autumn
© The Seasar Foundation and the others 2007. all rights reserved.
PRADO Frameworkとは
Frameworkとは
•
•
•
•
Zendコンテストグランプリ作品
Tapestry,ASP.NET,Delphiから影響
PHP5専⽤のフレームワーク
現在のバ ジョンは3 1 1
現在のバージョンは3.1.1
Seasar Conference
2007 Autumn
© The Seasar Foundation and the others 2007. all rights reserved.
PRADO Frameworkの特徴
Frameworkの特徴
•
•
•
•
•
コンポ ネント指向
コンポーネント指向
イベントドリブンなプログラミングスタイル
プレゼンテーションと処理の分離
豊富なWebコンポ ネント
豊富なWebコンポーネント
DBアクセスコンポーネントを標準提供
Seasar Conference
2007 Autumn
© The Seasar Foundation and the others 2007. all rights reserved.
コンポーネント指向
• さまざまな機能をコンポ
さまざまな機能をコンポーネントとして提供
ネントとして提供
• コンポーネントの組み合わせでアプリ構築
– テンプレートファイルで画⾯構築
– 設定ファイルでアプリケーション機能拡張
設定ファイルでアプリケ ション機能拡張
• 独⾃のコンポーネントの作成が可能
拡張性 再利⽤性が⾼
拡張性・再利⽤性が⾼い
Seasar Conference
2007 Autumn
© The Seasar Foundation and the others 2007. all rights reserved.
プレゼンテーションと処理の分離
• Page
P
= Template
T
l t + Class
Cl
XMLによる
画⾯構成
記述
記
Seasar Conference
2007 Autumn
PHPによる
処理ロジック
記述
© The Seasar Foundation and the others 2007. all rights reserved.
豊富なWeb
豊富な
Webコントロール群
コントロール群
• 豊富なWebコントロ
豊富なWebコントロールにて画⾯を構成
ルにて画⾯を構成
– 標準コントロール
– Validationコントロール
ト
– リストコントロール
– データコントロール
– Activeコントロール
– 独⾃コントロール
Seasar Conference
2007 Autumn
AJAXサポ ト
AJAXサポート
© The Seasar Foundation and the others 2007. all rights reserved.
イベントドリブン
• ユ
ユーザの操作をサーバーイベントとして取得
ザの操作をサ バ イベントとして取得
• イベントハンドラーとして処理を記述
Borland Delphi
Mi
Microsoft
f Visual
Vi
lB
Basic
i
などと似た作り
Seasar Conference
2007 Autumn
© The Seasar Foundation and the others 2007. all rights reserved.
DBアクセスコンポーネント
DB
アクセスコンポーネント
• ActiveRecord
– Ruby での O/R マッピングとして有名
– データベースのテーブルやビューの列をラップ
デ
ブ
ビ
プ
• SQLMap
– iBATIS Data Mapperを参考に作成されている
– SQLクエリーを活⽤
SQLクエリ を活⽤
状況により使い分け
Seasar Conference
2007 Autumn
© The Seasar Foundation and the others 2007. all rights reserved.
PRADO公式サイトへ!
PRADO
公式サイトへ!
• 興味を持たれた⽅は・・・
• 公式サイトへ
• http://pradosoft.com/
htt // d
ft
/
Seasar Conference
2007 Autumn
© The Seasar Foundation and the others 2007. all rights reserved.
公式サイト主コンテンツ
• チュ
チュートリアル
トリアル
• ユーザーフォーラム
• Wiki
チュートリアルの内容と共に
チ
トリアルの内容と共に
PRADOの機能を紹介します。
PRADOの機能を紹介します
Seasar Conference
2007 Autumn
© The Seasar Foundation and the others 2007. all rights reserved.
インストール/Hello
インストール/
Hello World
• PRADOのインスト
PRADOのインストール
ル
– インストーラをダウンロード
– ディレクトリに展開
デ
• Hello Worldアプリケ−ション
Worldアプリケ ション
Seasar Conference
2007 Autumn
© The Seasar Foundation and the others 2007. all rights reserved.
QuickStartチュートリアル
QuickStart
チュートリアル
• 通貨コンバ
通貨コンバーター
タ
– Webコンポーネントによる画⾯作成
– 標準、Validation、Activeの各種コンポーネント
ポ
• Ajaxチャット
– ActiveRecordによるデータアクセス
– TScaffoldViewによるCRUD画⾯作成
TS ff ldVi によるCRUD画⾯作成
<com:TScaffoldView RecordClass="UserRecord" />
Seasar Conference
2007 Autumn
© The Seasar Foundation and the others 2007. all rights reserved.
Blogチュートリアル
Blog
チュートリアル
• 5⽇間で標準的なWebアプリを構築
– 1⽇⽬
– 2⽇⽬
– 3⽇⽬
– 4⽇⽬
– 5⽇⽬
Seasar Conference
2007 Autumn
導⼊、Webコントロール、レイアウト
DBアクセス A ti R
DBアクセス、ActiveRecord
d
認証/承認
Webコントロール、 ActiveRecord
テーマ/スキンによる画⾯デザイン
エラ 処理/ロギング
エラー処理/ロギング
パフォーマンスチューニング
© The Seasar Foundation and the others 2007. all rights reserved.
その他機能
• JSON、Feed、SOAP
JSON Feed SOAP
• セキュリティ
– hidden項⽬の暗号化
– クロスサイトスクリプティング対応
• 単体テスト・機能テスト実⾏環境の標準提供
– SimpleTestによる単体テスト
よ 単体
ト
– Seleniumによる機能テスト
Seasar Conference
2007 Autumn
© The Seasar Foundation and the others 2007. all rights reserved.
S2Prado.PHP5とは
S2Prado.PHP5
とは
S2Container.PHP5と連携した
PRADOアプリケーションの構築を⽀援
アプリケ シ ンの構築を⽀援
• S2Prado Component
– S2Containerとの連携⽤コンポーネントを提供
• S2Prado Tools
– アプリ開発⽀援⽤各種コマンドを提供
Seasar Conference
2007 Autumn
© The Seasar Foundation and the others 2007. all rights reserved.
PRADOアプリの構成
PRADO
アプリの構成
DBアクセス
Page
View
Logic
テンプレート
ファイル
クラス
ファイル
肥⼤化?
Seasar Conference
2007 Autumn
Active
Record
SQL
Map
© The Seasar Foundation and the others 2007. all rights reserved.
ロジックの分離
DBアクセス
Page
Template
Class
Active
Record
Logic
プレゼンテーション
ロジック
Seasar Conference
2007 Autumn
業務
ロジック
SQL
Map
© The Seasar Foundation and the others 2007. all rights reserved.
S2Prado Component
Page
Template
S2Containerによる自動連結
Class
DBアクセス
Active
Record
Logic
プレゼンテーション
ロジック
Seasar Conference
2007 Autumn
業務
ロジック
SQL
Map
S2Dao
S
o
© The Seasar Foundation and the others 2007. all rights reserved.
S2Prado Component構成
Component構成
• PRADO基本クラスの拡張
– sprado.php
– SPradoBase.php
• PRADOサービスコンポーネントの拡張
PRADOサ ビスコンポ ネントの拡張
– SPageService.php
他
• S2Container連携⽤インターフェース
S2C t i 連携⽤インタ フ
ス
– IDIRequiredComponent.php
q
p
p p
Seasar Conference
2007 Autumn
© The Seasar Foundation and the others 2007. all rights reserved.
S2Prado アプリケーション構成
•
•
•
•
•
•
•
•
Seasar Conference
2007 Autumn
index.phpファイル
index
phpファイル
application.xmlファイル
業務ロジ ク/DAOクラス
業務ロジック/DAOクラス
レイアウト⽤クラス
ActiveRecordクラス
各種サ ビスコンポ ネント
各種サービスコンポーネント
テスト実⾏環境
テ マ
テーマ
© The Seasar Foundation and the others 2007. all rights reserved.
S2Prado⽤
S2Prado
⽤index.php
PRADO純正
require_once('prado/framework/prado.php');
$application=new TApplication();
$application->run();
S2Prado使⽤
define('S2CONTAINER_PHP5_AUTO_DI_INTERFACE',true);
require_once('s2prado/sprado.php');
$application=new TApplication();
$application->run();
Seasar Conference
2007 Autumn
© The Seasar Foundation and the others 2007. all rights reserved.
S2Prado アプリケーション設定
<?xml version="1.0"
version="1 0" encoding="utf
encoding="utf-8"?>
8"?>
<application id=”sprado”>
<modules>
<module id=
id="sprado"
sprado class=
class="SPrado"/>
SPrado />
(略)
</modules>
<services>
<service id="page" class="SPageService" />
(略)
</services>
</application>
コンテナ連携機能
拡張⽤モジュール
拡張⽤モジュ
ル
を登録
コンテナと連携するPageサービスを登録
Seasar Conference
2007 Autumn
© The Seasar Foundation and the others 2007. all rights reserved.
S2Containerによる依存性解決
S2Container
による依存性解決
・・・・・?page=UserLogin
SPageService
getComponent(“UserLogin”)
S2Container.PHP5
class UserLogin extends TPage implements IDIRequiredComponent {
private $service;
public function setService(UserLogic $service){
$this->service = $service;
}
Setter Injection
}
class
l UserLogicImpl
U L i I l implements
i l
U L i {
UserLogic
private $userDao;
Injection
(略)
}
Seasar Conference
2007 Autumn
UserDao
© The Seasar Foundation and the others 2007. all rights reserved.
S2Prado Tools
• コマンドラインツ
コマンドラインツールとして下記機能提供
ルとして下記機能提供
–
–
–
–
–
プロジェクト作成
実装中!
テスト環境作成
PHPシェル
テスト実⾏
コンポーネント・テストクラス雛形作成
php –f sprado-cli.php [コマンド名] [各種オプション]
Seasar Conference
2007 Autumn
© The Seasar Foundation and the others 2007. all rights reserved.
デモ
• Hello Worldアプリ構築
– (PRADO公式サイトより)
• S2Prado.PHP5を⽤いたアプリ構築
Seasar Conference
2007 Autumn
© The Seasar Foundation and the others 2007. all rights reserved.
Seasar PRADO プロジェクト
• PRADOに関する情報の充実
• S2Prado.PHP5の開発
• その他
http://prado.php5.sandbox.seasar.org/
で活動をはじめます。
で活動をはじめます
Seasar Conference
2007 Autumn
© The Seasar Foundation and the others 2007. all rights reserved.
PRADOに関する情報の充実
PRADO
に関する情報の充実
• PRADOドキュメントの翻訳推進
• PRADO公式フォーラムでの議論
• PRADO公式Wikiの活⽤
Seasar Conference
2007 Autumn
© The Seasar Foundation and the others 2007. all rights reserved.
S2Prado.PHP5の開発
S2Prado.PHP5
の開発
• S2Prado Componentの開発
– 設定ファイル記述量をより少なく
– HTMLテンプレート化の模索
プ
• S2Prado Toolの開発
– prado-cli.php形式
– S2Base
S2B
plugin形式
l i 形式
– GUIによる操作を可能に・・?
Seasar Conference
2007 Autumn
© The Seasar Foundation and the others 2007. all rights reserved.
その他
• PRADOを基盤としたプロダクト群の調査
– Prado Portal (Portalシステム)
– phundament (CMSシステム)
Seasar Conference
2007 Autumn
© The Seasar Foundation and the others 2007. all rights reserved.
募集
•活動メンバー
活動メンバ
•募集中です。
Seasar Conference
2007 Autumn
© The Seasar Foundation and the others 2007. all rights reserved.
最後に
•ご清聴
清聴
•ありがとう
•ございました
ございました
Seasar Conference
2007 Autumn
© The Seasar Foundation and the others 2007. all rights reserved.
Fly UP