Object::Relation::Setup - Set up a Object::Relation Data Store
use Object::Relation::Setup; my $setup = Object::Relation::Setup->new(\%params); $setup->setup;
This module is the base class for classes that set up a Object::Relation::Handle data store.
my $setup = Object::Relation::Setup->new(\%params);
This factory constructor creates and returns a new setup object. By default, it accepts the following parameters:
Determines which subclass of Object::Relation::Setup to use. The class can be specified as a full class name, such as Object::Relation::Setup::DB::Pg, or if it's in the Object::Relation::Setup namespace, you can just use the remainder of the class name, e.g., DB::Pg. Once Object::Relation::Setup has loaded the subclass, it will redispatch to its new() constructor. The class parameter defaults to DB::SQLite unless the constructor is called directly on the subclass, in which case that class will be used.
Object::Relation::Setup
DB::Pg
new()
class
DB::SQLite
An array refererence of the classes to search for classes that inherit from Object::Relation::Base. These will be passed to the load_classes method of Object::Relation::Schema; as such, the final value in the list may optionally be a File::Find::Rule object. Defaults to ['lib'] if not specified.
Object::Relation::Base
load_classes
['lib']
A boolean value indicating whether or not the setup should be verbose.
my $schema_class = Object::Relation::Setup->schema_class
Returns the name of the Object::Relation::Schema subclass that can be used to generate the schema code to build the data store. By default, this method returns the same name as the name of the Object::Relation::Setup subclass, but with "Store" replaced with "Schema".
my $store_class = Object::Relation::Setup->store_class
Returns the name of the Object::Relation::Handle subclass that manages the interface to the data store for Object::Relation applications. By default, this method returns the same name as the name of the Object::Relation::Setup subclass, but with "Build" removed.
my $verbose = $setup->verbose; $setup->verbose($verbose);
A boolean value idicating whether or not the setup should be verbose.
my @dirs = $setup->class_dirs; $setup->class_dirs(@dirs);
Gets or sets the list of directories that will be searched for classes that inherit from Object::Relation::Base. These will be passed to the load_classes method of Object::Relation::Schema; as such, the final value in the list may optionally be a File::Find::Rule object.
$setup->setup;
Sets up the data store. This is an abstract method that must be overridden in the subclasses.
$setup->load_schema;
Loads a Object::Relation::Schema object with all of the libraries found in the path specified by the class_dirs attribute.
class_dirs
Why? This loads an all of the libraries in an already installed Object::Relation platform, including, of course, the Object::Relation system classes. Then a complete database can be built including the system classes and the application classes. That's really only useful for tests, though.
$setup->nofify('Looking good...', $/);
Outputs setup notification messages. It simply prints all messages to if the verbose attribute is true.
verbose
Copyright (c) 2004-2006 Kineticode, Inc. <info@obj_relode.com>
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Object::Relation, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Object::Relation
CPAN shell
perl -MCPAN -e shell install Object::Relation
For more information on module installation, please visit the detailed CPAN module installation guide.