SlideShare a Scribd company logo
Model(Acl) Zend Framework ::
Model(Acl)ZFでモデルを構成するZend FrameworkプリセットDomain Driven Designテーマ
最近のZend Framework構築が楽になってきた日本語情報が増えてきた実案件が増えてるはずこのあと実案件の紹介があります。オープンソースも増えてきたデスクトップアプリのリプレースもできる
モデルこのスライド内ではドメインモデルPofEAAやDDDでのビジネスロジックそのものの抽象化model もしくはモデルMVCレイヤーでの区分としてここでは、DBモデルのことは指しません
Presentation LayerDomain LayerData Source Layerアプリケーション構造
シンプルなWebアプリケーション定番Presentation LayerView, ControllerData Source LayerTransaction ScriptDomain LayerModelZend_Db実用的にはこのパターンが多い。Transaction ScriptがService Layerに分類されることがある。http://www.martinfowler.com/eaaCatalog/transactionScript.html
もっとシンプルな・・・Presentation LayerViewData Source LayerTransaction ScriptDomain LayerControllerModelデータソース=モデルとするコントローラーにアプリケーションロジックを記載する批判される構成だが、E-ラーニングや製品デモには向いている
Data Source LayerDomain LayerActiveRecordPresentation LayerActiveRecordはデータベースのテーブルやビューの行をラップし、データベースアクセスをカプセル化し、ドメインロジックを追加するオブジェクトhttp://www.martinfowler.com/eaaCatalog/activeRecord.html
Domain LayerData Source LayerServiceLayerPresentation LayerPofEAA 9.4.2ビジネスロジックが1種類のクライアントしか持たず、ユースケースレスポンスにマルチトランザクションリソースが関連していない場合は、サービスレイヤーは不要プロジェクトの性質によって決定されるhttp://www.martinfowler.com/eaaCatalog/serviceLayer.html
DDD LayerUI LayerApplication LayerDomain LayerService LayerInfrastructure LayerビジネスロジックをDomain Layerで実現する
モデルを構成する
Stays out of your model designFramework Shootout, 30 January 2010http://www.slideshare.net/bngsudheer/framework-shootout-zf
クイックスタート :: create-modelhttp://framework.zend.com/manual/ja/learning.quickstart.create-model.htmlDbTableクラスの作成zf create db-table Guestbook guestbookモデルクラスの作成zf create model Guestbookコントローラーの作成zf create controller Guestbook
クラス配置ZFのMVCはmodule構成コマンドラインのツールzfでapplicationをセットアップ例) zf create project quickstartモジュール別Bootstrapを用意する=>モジュール別クラスのautoloadが可能にhttp://framework.zend.com/manual/ja/learning.autoloading.resources.html
クラス配置(モジュラー構成)Foo_Form_
Foo_Model_
Foo_Model_Mapper_
Foo_Model_DbTable_
Foo_Plugin_
Foo_Service_
Foo_BootstrapFooモジュールformsmodelsmodels/mappersmodels/DbTablepluginsservicesBootstrap.php例)  APP_DIR/application/Foo/ ->redirectUrl以下に配置Module_Bootstrapで拡張可能
Zend FrameworkのプリセットModel_Model_DbTable_Zend_Db_Tableを継承したテーブル毎のクラスModel_Mapper_Model  DbTable間のマッピングService_サービスレイヤー用
Presentation LayerDomain LayerData Source Layerレイヤーとの対応Service_Model_Model_Mapper_Model_DbTable_http://www.martinfowler.com/eaaCatalog/serviceLayer.html
Domain-Driven Designwith Zend Framework図:Domain-Driven Designより
DDD LayerUI LayerApplication LayerDomain LayerService LayerInfra LayerビジネスロジックをDomain Layerで実現するhttp://www.martinfowler.com/eaaCatalog/serviceLayer.html

More Related Content

PDF
Storytelling For The Web: Integrate Storytelling in your Design Process
PDF
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
PDF
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
PDF
2024 Trend Updates: What Really Works In SEO & Content Marketing
PPSX
Life with Zend Cache(1)
 
PPTX
Zend_Acl in ServiceLayer
 
PPSX
Life with Zend Cache (2)
 
PDF
2024 State of Marketing Report – by Hubspot
Storytelling For The Web: Integrate Storytelling in your Design Process
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
2024 Trend Updates: What Really Works In SEO & Content Marketing
Life with Zend Cache(1)
 
Zend_Acl in ServiceLayer
 
Life with Zend Cache (2)
 
2024 State of Marketing Report – by Hubspot
Ad

Architecture related with Zend Framework (Japanese only)