Re: [CDBI] CDBI Newbie Question

[prev] [thread] [next] [Date index for 2005/09/28]

From: Todd W
Subject: Re: [CDBI] CDBI Newbie Question
Date: 02:21 on 28 Sep 2005
> > Because I'm starting a Big Project, I'm trying to keep my modules tidy,
> > and have defined a hierarchy, with all my modules below ANPerl/; for
> > example, one of my DB table classes is
> >
ANPerl::AnalysisFramework::ResourceStore::Metadata::DBDiscoverySetResources
> >
> > Unfortunately now in my client code I have lines like
> >  $current_dsr_row =
> >
ANPerl::AnalysisFramework::ResourceStore::Metadata::DBDiscoverySetResources-
>create(
> >
> >       {RetrievalUrl => $retrieval_url} );
> >
> Maybe I'm misunderstanding, but have you looked at
>
> use lib qw/.../
>
> or export a PERL5LIB environmental var?
>
> Just because you stick a .pm somewhere down in a directory structure
> doesn't mean you have to have the package name refer to each directory
> above, especially if those parent dirs have nothing to do with perl
>

Thats what I was thinking when I read the post. You have your file:

ANPerl/AnalysisFramework/ResourceStore/Metadata/DBDiscoverySetResources.pm

and in that file declare the package like so:

package DBDiscoverySetResources;

> > Then [YOU] could just write
> >   $current_dsr_row = DBDiscoverySetResources->create( {RetrievalUrl =>
> > $retrieval_url} );

Whatever loaded the module before will load it the exact same way and you'll
have your CDBI stuff in a programmer friendly namespace.

Todd W.


_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

[CDBI] CDBI Newbie Question
Steven Mackenzie 16:26 on 27 Sep 2005

Re: [CDBI] CDBI Newbie Question
Matt S Trout 16:48 on 27 Sep 2005

Re: [CDBI] CDBI Newbie Question
Steven Mackenzie 17:44 on 27 Sep 2005

Re: [CDBI] CDBI Newbie Question
Bill Moseley 16:52 on 27 Sep 2005

Re: [CDBI] CDBI Newbie Question
Kingsley Kerce 16:55 on 27 Sep 2005

Re: [CDBI] CDBI Newbie Question
Steven Mackenzie 18:17 on 27 Sep 2005

Re: [CDBI] CDBI Newbie Question
Jay Strauss 02:02 on 28 Sep 2005

Re: [CDBI] CDBI Newbie Question
Todd W 02:21 on 28 Sep 2005

Re: [CDBI] CDBI Newbie Question
Steven Mackenzie 07:32 on 28 Sep 2005

Generated at 10:29 on 10 Oct 2005 by mariachi v0.52