Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added a general factory virtual class

  • Loading branch information...
commit 5f1f7aa5123d3ba38f559f3283d4ea80e4368a82 1 parent 706521a
Jerome Eteve authored
1  JCOM-BM/lib/JCOM/BM/DBICFactory.pm
... ... @@ -1,5 +1,6 @@
1 1 package JCOM::BM::DBICFactory;
2 2 use Moose;
  3 +extends qw/JCOM::BM::Factory/;
3 4
4 5 =head1 NAME
5 6
44 JCOM-BM/lib/JCOM/BM/Factory.pm
... ... @@ -0,0 +1,44 @@
  1 +package JCOM::BM::Factory;
  2 +use Moose;
  3 +
  4 +=head1 NAME
  5 +
  6 +JCOM::BM::Factory - A Factory class to inherit from
  7 +
  8 +=cut
  9 +
  10 +=head2 create
  11 +
  12 +Should create a new object given the parameters.
  13 +
  14 +=cut
  15 +
  16 +sub create{
  17 + my ($self) = @_;
  18 + confess("Please implement that");
  19 +}
  20 +
  21 +=head2 search
  22 +
  23 +Should return an iterable set of objects given the parameters.
  24 +
  25 +=cut
  26 +
  27 +sub search{
  28 + my ($self) = @_;
  29 + confess("Please implement that");
  30 +}
  31 +
  32 +=head2 find
  33 +
  34 +Just return one or zero object given the parameters.
  35 +
  36 +=cut
  37 +
  38 +sub find{
  39 + my ($self) = @_;
  40 + confess("Please implement that");
  41 +}
  42 +
  43 +__PACKAGE__->meta->make_immutable();
  44 +1;

0 comments on commit 5f1f7aa

Please sign in to comment.
Something went wrong with that request. Please try again.