NAME

Starch::Factory - Role applicator and class creator.

DESCRIPTION

This class consumes the Starch::Plugin::Bundle role and is used by Starch to apply specified plugins to manager, state, and store classes.

Normally there is no need to interact with this class directly.

OPTIONAL ARGUMENTS

plugins

This is the "plugins" in Starch::Plugin::Bundle attribute, but altered to be an argument.

base_manager_class

The base class of the Starch manager object. Default to Starch::Manager.

base_state_class

The base class of Starch state objects. Default to Starch::State.

ATTRIBUTES

manager_class

The anonymous class which extends "base_manager_class" and has "manager_roles" in Starch::Plugin::Bundle applied to it.

state_class

The anonymous class which extends "base_state_class" and has "state_roles" in Starch::Plugin::Bundle applied to it.

METHODS

base_store_class

    my $class = $factory->base_store_class( '::Memory' );
    # Starch::Store::Memory
    
    my $class = $factory->base_store_class( 'Starch::Store::Memory' );
    # Starch::Store::Memory

Given an absolute or relative store class name this will return the resolved class name.

store_class

    my $class = $factory->store_class( '::Memory' );

Given an absolute or relative store class name this will return an anonymous class which extends the store class and has "store_roles" in Starch::Plugin::Bundle applied to it.

new_store

    my $store = $factory->new_store( class=>'::Memory', %args );

Creates and returns a new "store_class" object with the factory argument set.

Note that since the "expires" in Starch::Store argument is required you must specify it.

SUPPORT

See "SUPPORT" in Starch.

AUTHORS

See "AUTHORS" in Starch.

COPYRIGHT AND LICENSE

See "COPYRIGHT AND LICENSE" in Starch.