ktats****@users*****
ktats****@users*****
2011年 4月 29日 (金) 02:02:32 JST
Index: docs/modules/DBIx-Class-0.08127/lib/DBIx/Class/Manual/Component.pod diff -u docs/modules/DBIx-Class-0.08127/lib/DBIx/Class/Manual/Component.pod:1.1 docs/modules/DBIx-Class-0.08127/lib/DBIx/Class/Manual/Component.pod:1.2 --- docs/modules/DBIx-Class-0.08127/lib/DBIx/Class/Manual/Component.pod:1.1 Fri Apr 29 01:44:57 2011 +++ docs/modules/DBIx-Class-0.08127/lib/DBIx/Class/Manual/Component.pod Fri Apr 29 02:02:31 2011 @@ -1,50 +1,98 @@ +=encoding utf8 =head1 NAME -DBIx::Class::Manual::Component - Developing DBIx::Class Components +DBIx::Class::Manual::Component - DBIx::Class ã³ã³ãã¼ãã³ããéçºãã -=head1 WHAT IS A COMPONENT +=head1 ã³ã³ãã¼ãã³ãã¨ã¯ä½ã + +=begin original A component is a module that can be added in to your DBIx::Class classes to provide extra functionality. A good example is the PK::Auto component which automatically retrieves primary keys that the database itself creates, after the insert has happened. -=head1 USING +=end original + +DBIx::Classã®ã¯ã©ã¹ã«ä»å çãªæ©è½ãæä¾ããããã«è¿½å ããã¢ã¸ã¥ã¼ã«ã®ãã¨ã§ãã +好ä¾ã¨ãã¦ã¯ãPK::Autoã³ã³ãã¼ãã³ããããã¾ããPK::Autoã¯ãinsertã®å¾ã«ã +ãã¼ã¿ãã¼ã¹èªèº«ããä½ã£ããã©ã¤ããªãã¼ãåãåºãã¾ãã + +=head1 使ãæ¹ + +=begin original Components are loaded using the load_components() method within your DBIx::Class classes. +=end original + +ã³ã³ãã¼ãã³ãã¯ãèªåã®DBIx::Class ã¯ã©ã¹ã®ä¸ã«ã load_components() +ã¡ã½ããã使ã£ã¦ããã¼ããã¾ãã + package My::Thing; use base qw( DBIx::Class::Core ); __PACKAGE__->load_components(qw/InflateColumn::DateTime TimeStamp/); +=begin original + Generally you do not want to specify the full package name of a component, instead take off the DBIx::Class:: part of it and just include the rest. If you do want to load a component outside of the normal namespace you can do so by prepending the component name with a +. +=end original + +ããã¦ããã³ã³ãã¼ãã³ãã®å®å ¨ãªããã±ã¼ã¸åãæå®ãããã¯ãªãã§ãããããã +ãã®ä»£ããã«ãDBIx::Class:: ã®é¨åãå¤ãã¦ãæ®ãã®é¨åã ããå«ãã¾ãã +é常ã®åå空é以å¤ã®ã³ã³ãã¼ãã³ãããã¼ãããããªãã +ã³ã³ãã¼ãã³ãåã®åã« + ãä»ãã¦ãã ããã + __PACKAGE__->load_components(qw/ +My::Component /); +=begin original + Once a component is loaded all of it's methods, or otherwise, that it provides will be available in your class. +=end original + +ã³ã³ãã¼ãã³ãããã¼ããããã¨ãå ¨ã¦ã®ã³ã³ãã¼ãã³ããæä¾ãã +ã¡ã½ãããèªåã®ã¯ã©ã¹ã§æå¹ã«ãªãã¾ãã + +=begin original + The order in which is you load the components may be very important, depending on the component. If you are not sure, then read the docs for the components you are using and see if they mention anything about the order in which you should load them. -=head1 CREATING COMPONENTS +=end original + +ã³ã³ãã¼ãã³ãããã¼ãããé çªã¯é常ã«éè¦ã§ããã³ã³ãã¼ãã³ãã«ä¾åãã¾ãã +ããããããªããã°ã使ã£ã¦ããã³ã³ãã¼ãã³ãã®ããã¥ã¡ã³ããèªã¿ã +ãã¼ããã¹ãé çªã«ã¤ãã¦ä½ãæ¸ããã¦ããããè¦ã¦ãã ããã + +=head1 ã³ã³ãã¼ãã³ããä½ã + +=begin original Making your own component is very easy. +=end original + +èªåèªèº«ã®ã³ã³ãã¼ãã³ããä½ãã®ã¯ã¨ã¦ãç°¡åã§ãã + package DBIx::Class::MyComp; use base qw(DBIx::Class); # Create methods, accessors, load other components, etc. 1; +=begin original + When a component is loaded it is included in the calling class' inheritance chain using L<Class::C3>. As well as providing custom utility methods, a component may also @@ -52,6 +100,16 @@ L<DBIx::Class::Row> and others. For example, you could override the insert and delete methods. +=end original + +ã³ã³ãã¼ãã³ãããã¼ããããã¨ãå¼ã³åºãã¦ããã¯ã©ã¹ã®ã +L<Class::C3>ã使ã£ããç¶æ¿ãã§ã¼ã³ã«å«ã¾ãã¾ãã +ã«ã¹ã¿ã ã¦ã¼ãã£ãªãã£ã¡ã½ãããæä¾ããã®ã¨åæ§ã«ã +ã³ã³ãã¼ãã³ãããä»ã®ã³ã¢ã³ã³ãã¼ãã³ãã§æä¾ããã¦ãã +ã¡ã½ãããä¸æ¸ãããããããã¾ãããL<DBIx::Class::Row>ã +ãã®ä»ã®ã³ã³ãã¼ãã³ãã®ããã«ã +ä¾ãã°ãinsert 㨠delete ã¡ã½ããããªã¼ãã¼ã©ã¤ãã§ãã¾ãã + sub insert { my $self = shift; # Do stuff with $self, like set default values. @@ -64,6 +122,8 @@ return $self->next::method( @_ ); } +=begin original + Now, the order that a component is loaded is very important. Components that are loaded first are the first ones in the inheritance stack. So, if you override insert() but the DBIx::Class::Row component is loaded first @@ -71,65 +131,200 @@ will be called first. If you are unsure as to why a given method is not being called try printing out the Class::C3 inheritance stack. +=end original + +ãããªãã¨ãã³ã³ãã¼ãã³ãããã¼ãããé çªã¯ã¨ã¦ãéè¦ã§ãã +æåã«ãã¼ããããã³ã³ãã¼ãã³ãã¯ãç¶æ¿ã¹ã¿ãã¯ã®æåã®ãã®ã§ãããã®ããã +insert() ããªã¼ãã¼ã©ã¤ãããã¨ãã¦ãDBIx::Class::Rowã³ã³ãã¼ãã³ããæåã« +ãã¼ããããã¨ãèªåã®insert()ã¯ã決ãã¦å¼ã°ãã¾ãããDBIx::Class::Row insert() +ãæåã«å¼ã°ãã¦ãã¾ãã¾ããããããã¡ã½ãããå¼ã°ããªããããããããªããã°ã +Class::C3 ã®ç¶æ¿ã¹ã¿ãã¯ãåºåãã¦ã¿ã¦ãã ããã + print join ', ' => Class::C3::calculateMRO('YourClass::Name'); +=begin original + Check out the L<Class::C3> docs for more information about inheritance. -=head1 EXISTING COMPONENTS +=end original + +ç¶æ¿ã«ã¤ãã¦ãã詳ããã¯ãL<Class::C3>ã®ããã¥ã¡ã³ãããã§ãã¯ãã¦ãã ããã -=head2 Extra +=head1 åå¨ããã³ã³ãã¼ãã³ã + +=head2 ä»å çãªãã® + +=begin original These components provide extra functionality beyond basic functionality that you can't live without. +=end original + +ä¸è¨ã®ã³ã³ãã¼ãã³ãã¯åºæ¬çãªæ©è½ãè¶ããã +ããç¡ãã§ã¯çãã¦ãããªããããªãä»å çãªæ©è½ãæä¾ãã¾ãã + +=begin original + L<DBIx::Class::CDBICompat> - Class::DBI Compatibility layer. +=end original + +L<DBIx::Class::CDBICompat> - Class::DBI äºæã¬ã¤ã¤ã + +=begin original + L<DBIx::Class::FormTools> - Build forms with multiple interconnected objects. +=end original + +L<DBIx::Class::FormTools> - è¤æ°ã®é¢é£ãããªãã¸ã§ã¯ãã§ãã©ã¼ã ãä½ãã + +=begin original + L<DBIx::Class::HTMLWidget> - Like FromForm but with DBIx::Class and HTML::Widget. +=end original + +L<DBIx::Class::HTMLWidget> - FromFormã¨ä¼¼ã¦ãã¾ãããDBIx::Class ã¨HTML::Widgetã + +=begin original + L<DBIx::Class::Ordered> - Modify the position of objects in an ordered list. +=end original + +L<DBIx::Class::Ordered> - æ´åããããªã¹ãå ã®ãªãã¸ã§ã¯ãã®ä½ç½®ãä¿®æ£ããã + +=begin original + L<DBIx::Class::PK::Auto> - Retrieve automatically created primary keys upon insert. +=end original + +L<DBIx::Class::PK::Auto> - insert ã§ãèªåçã«ä½ããããã©ã¤ããªãã¼ãåå¾ããã + +=begin original + L<DBIx::Class::QueriesTime> - Display the amount of time it takes to run queries. +=end original + +L<DBIx::Class::QueriesTime> - ã¯ã¨ãªãå®è¡ããã®ã«ããã£ãæéã表示ããã + +=begin original + L<DBIx::Class::RandomStringColumns> - Declare virtual columns that return random strings. +=end original + +L<DBIx::Class::RandomStringColumns> - ã©ã³ãã ãªæååãè¿ãä»®æ³ã«ã©ã ã宣è¨ããã + L<DBIx::Class::UUIDColumns> - Implicit UUID columns. +=begin original + L<DBIx::Class::WebForm> - CRUD methods. -=head2 Experimental +=end original + +L<DBIx::Class::WebForm> - CRUD ã¡ã½ããã + +=head2 å®é¨ç These components are under development, their interfaces may change, they may not work, etc. So, use them if you want, but be warned. +ä¸è¨ã®ã³ã³ãã¼ãã³ãã¯éçºä¸ã§ããã¤ã³ã¿ã¼ãã§ã¼ã¹ã¯ä»£ããããããã¾ãããã +åããªãã£ããããããããã¾ããããæã¿ãªã使ã£ã¦ãã ããã +ãã ãã注æãã¦ãã ããã + +=begin original + L<DBIx::Class::Validation> - Validate all data before submitting to your database. -=head2 Core +=end original + +L<DBIx::Class::Validation> - ãã¼ã¿ãã¼ã¹ã«å ¥ããåã«å ¨ã¦ã®ãã¼ã¿ãæ£ããã確èªããã + +=head2 ã³ã¢ + +=begin original These are the components that all, or nearly all, people will use without even knowing it. These components provide most of DBIx::Class' functionality. +=end original + +ä¸è¨ã®ã³ã³ãã¼ãã³ãã¯å ¨ã¦ã®ãã»ã¨ãã©å ¨ã¦ã®ã人ããããç¥ããªãã¦ã使ãã§ãããã +ä¸è¨ã®ã³ã³ãã¼ãã³ãã¯DBIx::Classã®æ©è½ã®ã»ã¨ãã©ãæä¾ãã¾ãã + +=begin original + L<DBIx::Class::Core> - Loads various components that "most people" would want. +=end original + +L<DBIx::Class::Core> - "ã»ã¨ãã©ã®äºº"ã欲ããæ§ã ãªã³ã³ãã¼ãã³ãããã¼ããã¾ãã + +=begin original + L<DBIx::Class::AccessorGroup> - Lets you build groups of accessors. +=end original + +L<DBIx::Class::AccessorGroup> - ã¢ã¯ã»ãµã®ã°ã«ã¼ãä½ãã¾ãã + +=begin original + L<DBIx::Class::DB> - Non-recommended classdata schema component. +=end original + +L<DBIx::Class::DB> - éæ¨å¥¨ã®ã¯ã©ã¹ãã¼ã¿ã¹ãã¼ãã³ã³ãã¼ãã³ãã + +=begin original + L<DBIx::Class::InflateColumn> - Automatically create objects from column data. +=end original + +L<DBIx::Class::InflateColumn> - ã«ã©ã ãã¼ã¿ããèªåçã«ãªãã¸ã§ã¯ããä½ãã + +=begin original + L<DBIx::Class::PK> - This class contains methods for handling primary keys and methods depending on them. +=end original + +L<DBIx::Class::PK> - ãã®ã¯ã©ã¹ã¯ãã©ã¤ããªãã¼ãæ±ãã¡ã½ããã¨ããã«ä¾åããã¡ã½ãããå«ã¿ã¾ãã + +=begin original + L<DBIx::Class::Relationship> - Inter-table relationships. +=end original + +L<DBIx::Class::Relationship> - ãã¼ãã«éã®ãªã¬ã¼ã·ã§ã³ã·ããã + +=begin original + L<DBIx::Class::ResultSourceProxy::Table> - Provides a classdata table object and method proxies. +=end original + +L<DBIx::Class::ResultSourceProxy::Table> - ã¯ã©ã¹ãã¼ã¿ãã¼ãã«ãªãã¸ã§ã¯ãã¨ã¡ã½ãããããã·ãæä¾ãã¾ãã + +=begin original + L<DBIx::Class::Row> - Basic row methods. +=end original + +L<DBIx::Class::Row> - åºæ¬çãªåã®ã¡ã½ããã + =head1 SEE ALSO L<DBIx::Class::Manual::Cookbook> @@ -137,3 +332,18 @@ =head1 AUTHOR Aran Clary Deltac <bluef****@cpan*****> + + +=head1 翻訳ã«ã¤ã㦠+ +翻訳è ï¼å è¤æ¦ (ktat.****@gmail*****) + +Perlããã¥ã¡ã³ãæ¥æ¬èªè¨³ Project ã«ã¦ã +Perlã¢ã¸ã¥ã¼ã«ãããã¥ã¡ã³ãã®ç¿»è¨³ãè¡ã£ã¦ããã¾ãã + + http://perldocjp.sourceforge.jp/ + http://sourceforge.jp/projects/perldocjp/ + http://www.freeml.com/perldocjp/ + http://www.perldoc.jp + +=cut