Thanks for the pointer to App::Info - it looks interesting. DBD::Informix already has to do a lot of stuff like that - and has classes which supports its efforts. Integrating that into a App::Info framework probably isn't too hard.
No, probably not. DBD::Pg has done this.
Question for you - not immediately clear from the docs. If I decide I want to use App::Info in Makefile.PL (or Build.PL) for DBD::Informix, do I have to put App::Info::RDBMS::Informix onto CPAN and persuade people to download it to their machine and install it - and App::Info too - or is there a way to ship App::Info::RDBMS::Informix and supporting code with DBD::Informix?
I would do it the way we did it in DBD::Pg: Put it in t/lib:
geertz% find t/lib | grep -v CVS t/lib t/lib/App t/lib/App/Info t/lib/App/Info/Handler t/lib/App/Info/Handler/Prompt.pm t/lib/App/Info/Handler.pm t/lib/App/Info/RDBMS t/lib/App/Info/RDBMS/PostgreSQL.pm t/lib/App/Info/RDBMS.pm t/lib/App/Info/Request.pm t/lib/App/Info/Util.pm t/lib/App/Info.pm
Then you can just use it in Makefile.PL like this:
use File::Spec; use lib File::Spec->catdir(qw(t lib)); use App::Info::RDBMS::Informix;
Or copy the funky code from DBD::Pg's Makefile.PL (designed to support systems without File::Spec).
Also, I note that there are methods such as bin_dir, lib_dir, and so on. Is there (yet) a method that would return the 'base_dir' or 'home_dir' of an application? For example, Informix is located via the $INFORMIXDIR environment variable; then bin_dir is $INFORMIXDIR/bin and so on. I believe Oracle is similarly located via $ORA_HOME or something similar.
No, but it's not a bad idea. I'll think about adding it. You can always add it to your subclass, of course.
Would it be plausible to add application-specific methods too - for example, App::Info::RDBMS::Informix::INFORMIXSERVER to determine the name of the default server, and A::I::R::I::INFORMIXSQLHOSTS to locate the sqlhosts file, etc?
Sure, if you want. But I think I would make those lowercase, just to adhere to the typical Perl style. App::Info::HTTPD::Apache has its own methods that extend those defined by App::Info.
Finally, for now, what would you expect me to do to support different sub-products within the Informix collection? For sake of discussion, there are three servers, IDS, XPS, and SE, and the client libraries to access these, CSDK. Are these all RDBMS category? Probably... Do we stick them in App::Info::RDBMS::Informix::IDS, App::Info::RDBMS::Informix::XPS, etc?
Sure, that makes sense to me. Although maybe libraries should just go into App::Info::Lib.
I'm not even sure I need to distinguish between the different servers - but it might be that the server (IDS for convenience) is installed in one place and the CSDK is installed in a separate place. As it happens, DBD::Informix is primarily concerned that there is a CSDK installation available on the compiling machine - it doesn't matter where the database server actually is as long as the connectivity is configured correctly.
It's up to you to decide how much of the Informix suite you want to support. I'd welcome any contribution. And, yeah, I think it'd be cool to put it on CPAN, too, even if you do include it with DBD::Informix.
Cheers,
David
