* Eric Wilhelm <ewilhelm at sbcglobal.net> [2004/01/21 10:58]:
> I'm trying to find a good way for CAD::Drawing::IO to determine which
> of the CAD::Drawing::IO::* modules are available.

It sounds like what you want is to ensure that the IO::* modules are
polymorphic, i.e., to ensure that they all adhere to the same interface.
Then, like DBI, CAD::Drawing::IO can be setup to load the appropriate
implementation module (no groveling in @INC, that's what require is
for), instantiate an object, and then call the appropriate methods on
that object.  Your main module (IO.pm) shouldn't need to have knowledge
of the various IO::* modules.

> Basically, there are save() and load() functions in IO.pm which allow
> an explicit "type" argument or the type can be derived from the file
> extension.

At this point, IO.pm should load the right module with require, and then
defer to that module's methods to do the right thing for loading,
saving, etc.

(darren)

-- 
You win again, gravity!

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to