Manager class in same file as object class?

13 views
Skip to first unread message

henq

unread,
Nov 14, 2015, 8:35:14 AM11/14/15
to Rose::DB::Object
Hi,

If I put the  ..::Manager package  in the same file as the object package, the standard perl use function will not be able to find it.

  # MyApp::Models/User.pm
  package MyApp::Models::User::Manager;
  use base qw(Rose::DB::Object::Manager);
  sub object_class { 'MyApp::Models::User'}
  __PACKAGE__->make_manager_methods('users');
  1;

  #-------------------------------------------------- 

  package MyApp::Models::User;
  use base qw(MyApp::DB::Object);
  ....
  1;


# Some other file.pm
use MyApp::Models::User::Manager;    #error 


Perl expects by convention to find MyApp::Models::User::Manager in the file MyApp::Models/User/Manager.pm. Is there a clean way to avoid the need to create an extra directory and a small file called Manager.pm, for each object class? 
(This is more of a perl question than Rose, but I think people here have already experimented with this issue).
TIA
~henq


Reply all
Reply to author
Forward
0 new messages