Reaction::Manual::Internals
Moose
A complete modern object system for Perl 5.
Use shorter package names, i.e., "X::Y::Z" as "Z".
The MVC application framework Reaction uses.
Catalyst::Controller::BindLex
Catalyst::Model::DBIC::Schema
Catalyst::Plugin::ConfigLoader
Catalyst::Plugin::I18N
Catalyst::Plugin::Static::Simple
Catalyst::View::TT
Template Toolkit
Generic config file module.
Object/Relational mapper.
Utility class, sets up to export a few methods that return parameters for use within Moose's has (as new parameters) in other packages. It also uses Moose itself.
has
use
The methods it injects are:
The attribute is required, if not provided beforehand the build_${name} method will be called on the object when the attribute's getter is first called. If the method does not exist, or returns undef, an error will be thrown.
The attribute is required, if not provided beforehand the 'lazy' parameter of Moose will make it fail.
Calls adopt_${type} after the attribute value is set to $type.
Will mark the calling package as already included, using %INC.
A method "adaptor" that creates the needed objects to support CRUD DBIC actions. In the future the code could be moved to a class higher in the hierarchy and only contain the operations to adapt.
Sample run:
Reaction::InterfaceModel::Action::DBIC::ActionReflector->reflect_actions_for( Reaction::InterfaceModel::Action::DBIC::ActionReflector=HASH(0x93cb2f0) RTest::TestDB::Foo ComponentUI::Model::Action )
Generates and evaluates:
package ComponentUI::Model::Action::DeleteFoo; use Reaction::Class; extends 'Reaction::InterfaceModel::Action::DBIC::Result::Delete'; package ComponentUI::Model::Action::UpdateFoo; use Reaction::Class; extends 'Reaction::InterfaceModel::Action::DBIC::Result::Update'; has 'baz_list' => (isa => 'ArrayRef', is => 'rw', set_or_lazy_fail('baz_list'), default => sub { [] }, valid_values => sub { $_[0]->target_model ->result_source ->related_source('links_to_baz_list') ->related_source('baz') ->resultset; }); has 'last_name' => (isa => 'NonEmptySimpleStr', is => 'rw', set_or_lazy_fail('last_name')); has 'first_name' => (isa => 'NonEmptySimpleStr', is => 'rw', set_or_lazy_fail('first_name')); package ComponentUI::Model::Action::CreateFoo; use Reaction::Class; extends 'Reaction::InterfaceModel::Action::DBIC::ResultSet::Create'; has 'baz_list' => (isa => 'ArrayRef', is => 'rw', set_or_lazy_fail('baz_list'), default => sub { [] }, valid_values => sub { $_[0]->target_model ->result_source ->related_source('links_to_baz_list') ->related_source('baz') ->resultset; }); has 'last_name' => (isa => 'NonEmptySimpleStr', is => 'rw', set_or_lazy_fail('last_name')); has 'first_name' => (isa => 'NonEmptySimpleStr', is => 'rw', set_or_lazy_fail('first_name'));
Don't use =over N. POD assumes that the indent level is 4 if you leave it out. Most POD renderers ignore your indent level anyway.
=over N
Packages involved
t/lib/Rtest/TestDB*: TestDB DBIC declarations. t/lib/RTest/TestDB.pm: does DBIC populate for t/. t/lib/RTest/UI/ XXX
Reaction::Test::WithDB; Reaction::Test; Reaction::Test::Mock::Context; Reaction::Test::Mock::Request; Reaction::Test::Mock::Response;
See Reaction::Class for authors.
See Reaction::Class for the license.
To install Reaction, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Reaction
CPAN shell
perl -MCPAN -e shell install Reaction
For more information on module installation, please visit the detailed CPAN module installation guide.