Catalyst::Model::Adaptor

  • 3,640 views
Uploaded on

CatCon#1

CatCon#1

More in: Technology , Sports
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
3,640
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
18
Comments
0
Likes
3

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Catalyst::Model::Adaptor Hideo Kimura (hide-k)
  • 2. Catalyst のいやんなところ • component が context に依存してるー>特に Model! • MyApp::M::Foo にビジネスロジックを実装する と Catalyst でしか使えない • Test が面倒くさい!
  • 3. そこで C::M::Adaptor • 既存クラスを C::Model にしてくれる アダプタークラス • 必要なのは – Model にしたいクラス • 超簡単!
  • 4. 作り方 Helper がついてる script/myapp_create model Foo Adaptor Foo::Class create package MyApp::Model::Foo; use strict; use warnings; use base 'Catalyst::Model::Adaptor'; __PACKAGE__->config( class => ‘Foo::Class', constructor => ‘create', ); 1;