Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added a general factory virtual class

  • Loading branch information...
commit 5f1f7aa5123d3ba38f559f3283d4ea80e4368a82 1 parent 706521a
@jeteve authored
View
1  JCOM-BM/lib/JCOM/BM/DBICFactory.pm
@@ -1,5 +1,6 @@
package JCOM::BM::DBICFactory;
use Moose;
+extends qw/JCOM::BM::Factory/;
=head1 NAME
View
44 JCOM-BM/lib/JCOM/BM/Factory.pm
@@ -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.
Something went wrong with that request. Please try again.