=head1 NAME ResourcePool::BigPicture - ResourcePool introduction =head1 DESCRIPTION The ResourcePool package consists of three major parts: =over 4 =item * ResourcePool =item * LoadBalancer =item * Command framework =back The overview of this three parts will be described in this document. =head1 ResourcePool The L is used to manage a pool of persistent connections (or more generally "resources"). Every resource in a pool is exactly equivalent to the others since all of them are created through the same factory. If you want to make a pool of different resources (e.g. connections to different databases) you have to use the L. The L uses two other classes to operate: =over 4 =item ResourcePool::Factory used to create resources =item ResourcePool::Resource used as wrapper to implement a unique interface to all resources =back To create a L you need a L which is able to create the L you want to use. The L will then use this factory to create L objects as required. The L itself creates the finally interesting objects like L or L and provides a standard way to perform the common operations required by L to work with this resource. The L and L classes are base classes to inherit the specialized classes for your resource from. The classes to handle L and L resources are available as separate distributions on CPAN. After creating a L you can use the L method to obtain a resource. The L method will return the L or L object which can be used as usually. Afterwards you have to hand the resource back into the pool by calling the L method. Please have a look to the L for further details. =head1 ResourcePool::LoadBalancer A L can be used to configure a failover and/or loadbalancing behavior for L users. To construct a L you need one or more L. After construction a L behaves like a L, so you can call the L method to obtain a resource and can use the L strategy. The L can be configured to use a different L every time you call the L method. The L can also detect a problem with a L (e.g. because the related server is down) and will hide such problems from you. There are currently three "Policies" which change the way the L uses the configured resources: =over 4 =item * RoundRobin =item * LeastUsage =item * FailBack =item * FailOver =back =head1 Command framework The L package includes a framework which can be used to execute commands like described in the GOF book "Design Patterns". You can use this pattern to avoid manual use of the L, L and L methods. The common code used to work with L or L (get resource, use it, return it to the pool) has been encapsulated into the L method. The Command framework will it make easier to handle errors, and is capable of re-trying the complete work if an error occured. Using this pattern can help you to forget (nearly) about error handling since everything is handled in L and L. More details how to use this pattern can be found in the L documentation. This pattern does also allow to use L and L for a complete new type of resources like L. In that case you can use L to spread load and handle failover for SOAP RPC calls. Have a look at L for details about this approach. =head1 Learn More You should have the big picture of L and L now, time to go into the details at the L and L documentation. If you loose track of all these modules consult the L diagram. The best entry point for the Command pattern is the L documentation. Have a look at the L documentation for a database related example or L documentation for a SOAP RPC example. To learn more about how to implement your own resource extensions have a look to the L. =head1 SEE ALSO L, L, L =head1 AUTHOR Copyright (C) 2001-2005 by Markus Winand This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.