Permalink
Browse files

Added a general factory virtual class

  • Loading branch information...
1 parent 706521a commit 5f1f7aa5123d3ba38f559f3283d4ea80e4368a82 @jeteve committed Feb 7, 2012
Showing with 45 additions and 0 deletions.
  1. +1 −0 JCOM-BM/lib/JCOM/BM/DBICFactory.pm
  2. +44 −0 JCOM-BM/lib/JCOM/BM/Factory.pm
@@ -1,5 +1,6 @@
package JCOM::BM::DBICFactory;
use Moose;
+extends qw/JCOM::BM::Factory/;
=head1 NAME
@@ -0,0 +1,44 @@
+package JCOM::BM::Factory;
+use Moose;
+
+=head1 NAME
+
+JCOM::BM::Factory - A Factory class to inherit from
+
+=cut
+
+=head2 create
+
+Should create a new object given the parameters.
+
+=cut
+
+sub create{
+ my ($self) = @_;
+ confess("Please implement that");
+}
+
+=head2 search
+
+Should return an iterable set of objects given the parameters.
+
+=cut
+
+sub search{
+ my ($self) = @_;
+ confess("Please implement that");
+}
+
+=head2 find
+
+Just return one or zero object given the parameters.
+
+=cut
+
+sub find{
+ my ($self) = @_;
+ confess("Please implement that");
+}
+
+__PACKAGE__->meta->make_immutable();
+1;

0 comments on commit 5f1f7aa

Please sign in to comment.