- Timestamp:
- 06/03/08 22:47:53 (5 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
docs/cat-ja/Catalyst/Manual/ExtendingCatalyst.pod
r13137 r13140 1 =head1 NAME1 =head1 名前(NAME) 2 2 3 3 Catalyst::Manual::ExtendingCatalyst - フレームワークを拡張する 4 4 5 =head1 DESCRIPTION5 =head1 概要(DESCRIPTION) 6 6 7 7 This document will provide you with access points, techniques and best … … 41 41 IRC などで話しかけてください。 42 42 43 =head1 BEST PRACTICES43 =head1 ベストプラクティス(BEST PRACTICES) 44 44 45 45 During Catalyst's early days, it was common to write plugins to … … 56 56 forward to L</Namespaces>. 57 57 58 =head2 Quick Checklist 58 もし君がめっちゃいそいでいるのなら、以下に必須のポイントに関するクイックチェック 59 リストを容易したからそれだけでもよんでいきたまえ。もし君がまったりとこの文書を全 60 部読むつもりなら L</Namespaces> に進む。 61 62 =head2 3分間チェックリスト(Quick Checklist) 59 63 60 64 =over 61 65 62 =item Use the C<CatalystX::*> namespace if you can! 63 64 C<CatalystX::*> というネームスペースをつかいましょう 66 =item C<CatalystX::*> というネームスペースをつかいましょう(Use the C<CatalystX::*> namespace if you can!) 65 67 66 68 If your extension isn't a Model, View, Controller, Plugin, or Engine, … … 72 74 C<CatalystX::> をかわりにつかってください。 73 75 74 =item Don't make it a plugin unless you have to!76 =item プラグインはつくらない(どうしてもつくらなきゃいけない場合をのぞいて)!(Don't make it a plugin unless you have to!) 75 77 76 78 A plugin should be careful since it's overriding Catalyst internals. … … 81 83 が、内部を上書きしたいんでなければ、Controller か Model にしてね! 82 84 83 =item There's a community. Use it! 84 85 コミュあるから利用しちゃおう! 85 =item コミュニティがあるから利用しちゃおう!(There's a community. Use it!) 86 86 87 87 There are many experienced developers in the Catalyst community, … … 90 90 Catalyst には IRC も ML もあるから、どんどん利用しちゃおう! 91 91 92 =item Add tests and documentation! 93 94 テストとドキュメンテーションはしっかりね! 92 =item テストとドキュメンテーションはしっかりね!(Add tests and documentation!) 95 93 96 94 This gives a stable basis for contribution, and even more importantly, … … 102 100 =back 103 101 104 =head2 Namespaces 105 106 ネームスペース 102 =head2 ネームスペース(Namespaces) 107 103 108 104 While some core extensions (engines, plugins, etc.) have to be placed … … 112 108 コアの拡張(engine や plugin とか)は、C<Catalyst::*> におくべきだけど、そういうの 113 109 つくるときは開発者に相談してからにしよう。できることなら C<CatalystX::*> におこう。 110 111 (訳注: CPAN にアップロードする場合、相談してからやらないと mst に痛烈に DIS られます) 114 112 115 113 When you try to put a base class for a C<Model>, C<View> or … … 121 119 as examples. 122 120 123 =head2 Can it be a simple module? 124 125 それをシンプルなモジュールにすることはできませんか? 121 =head2 それをシンプルなモジュールにすることはできませんか?(Can it be a simple module?) 126 122 127 123 Sometimes you want to use functionality in your application that … … 270 266 L<Catalyst::Component/"ACCEPT_CONTEXT($c, @args)">. 271 267 272 =head1 CONFIGURATION 273 274 設定 268 =head1 設定(CONFIGURATION) 275 269 276 270 The application has to interact with the extension with some 277 271 configuration. There is of course again more than one way to do it. 278 272 279 =head2 Attributes 280 281 アトリビュート 273 =head2 アトリビュート(Attributes) 282 274 283 275 You can specify any valid Perl attribute on Catalyst actions you like. … … 301 293 class|/"Component Base Classes">. 302 294 303 =head2 Creating custom accessors 304 305 カスタムアクセサをつくる 295 =head2 カスタムアクセサをつくる(Creating custom accessors) 306 296 307 297 L<Catalyst::Component> uses L<Class::Accessor::Fast> for accessor … … 312 302 います。 313 303 314 =head2 Component configuration 315 316 コンポーネントの設定 304 =head2 コンポーネントの設定(Component configuration) 317 305 318 306 At creation time, the class configuration of your component (the one … … 339 327 my $model_name = $controller->model_name; 340 328 341 =head1 IMPLEMENTATION 342 343 実装 329 =head1 実装(IMPLEMENTATION) 344 330 345 331 This part contains the technical details of various implementation … … 347 333 implementation, if you haven't already. 348 334 349 =head2 Action classes335 =head2 Actionクラス(Action classes) 350 336 351 337 Usually, your action objects are of the class L<Catalyst::Action>. … … 415 401 L<Catalyst::Action> and L<Catalyst::Manual::Actions>. 416 402 417 =head2 Component base classes403 =head2 コンポーネントなクラス(Component base classes) 418 404 419 405 Many L<Catalyst::Plugin> that were written in Catalyst's early days … … 421 407 class, you could provide functionality scoped to a single controller, 422 408 not polluting the global namespace in the context object. 409 410 Catalyst がうまれたての頃に多くの L<Catalyst::Plugin> が書かれました。 423 411 424 412 You can provide regular Perl methods in a base class as well as … … 432 420 already provided via the C<+> prefix for action classes. A simple 433 421 422 シンプルな 423 434 424 sub foo : Local ActionClass('+MyApp::Action::Bar') { ... } 435 425 436 426 will use C<MyApp::Action::Bar> as action class. 427 428 は、C<MyApp::Action::Bar> を Action クラスとしてつかいます。 437 429 438 430 package MyApp::Base::Controller::FullClass; use strict; use base … … 457 449 1; 458 450 459 =head2 Controllers451 =head2 コントローラ(Controllers) 460 452 461 453 Many things can happen in controllers, and it often improves … … 546 538 =back 547 539 548 =head2 Models and Views540 =head2 モデルとビュー(Models and Views) 549 541 550 542 If the functionality you'd like to add is really a data-set that you … … 586 578 1; 587 579 588 =head2 Plugins 589 590 プラギン 580 =head2 プラグイン(Plugins) 591 581 592 582 The first thing to say about plugins is that if you're not sure if … … 641 631 implementation (excuse the lame class name, it's just an example): 642 632 633 プラグインの実装は簡単なようにみえます。あなたのプラグインは Catalyst の継承ツリー 634 の上にはいります。これによりあなたは、Catalyst のリクエストライフサイクルの挙動を 635 変えることができます。あなたが定義したりあなたのパッケージに import したメソッド 636 は、すべてアプリケーションとコンテキストオブジェクトにはえます。例としてあなたが 637 Catalyst に uri_for の返り値が undef だったとき警告をだすプラグインをつくったとし 638 ましょう。(中略)(アホみたいなクラス名ですいません。これは例なので勘弁してね) 639 643 640 package Catalyst::Plugin::UriforUndefWarning; 644 641 use strict; … … 658 655 value. 659 656 660 =head2 Factory components with COMPONENT() 661 662 COMPONENT() をつかってコンポーネントを生成する 657 これは Catalyst の C<uri_for> メソッドをうわがきし、undef がかえってきたら警告を 658 ログに吐きだします。 659 660 =head2 COMPONENT() をつかってコンポーネントを生成する(Factory components with COMPONENT()) 663 661 664 662 Every component inheriting from L<Catalyst::Component> contains a … … 720 718 721 719 =cut 722
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)