lattice has asked for the wisdom of the Perl Monks concerning the following question:
or something very similar (the 'connect' method could be replaced with anything, but it's familiar since DBI's pretty well known).$myObj = Obj->connect( $source, @additionalArgs ); $myObj->some_operations; $myObj->set_output( 'html' ); $myObj->output;
The way I have the object model physically structured is as follows:
Obj
|
+-- Input
| |
| +-- DB
| +-- XML
| +-- Hash
| +-- etc.
|
+-- Output
|
+-- HTML
+-- XML
+-- etc.
Now, the crux of the problem is that I don't want the
programmer using this module to have to worry about
creating a new Obj::Input::XML object. I want that to be
part of the calling syntax, ala Tim.Also, I'm having some trouble deciding when to use inheritance, since it's rather a strange situation.
Should MyObj be in MyObj::Input::*'s @ISA, or should the Input::* classes inherit from a generic MyObj::Input class that doesn't inherit from MyObj? I'm rather confused, since MyObj::Input::* is used by MyObj, rather than a subclass.
I would provide an example snippet, but I'm trying to figure out the starting point, so snippets are hard to come by ;-p
Any help to smooth my very confused line of thought would be MUCH appreciated.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Object Heirarchy / Design
by btrott (Parson) on Nov 15, 2000 at 06:28 UTC | |
by lattice (Initiate) on Nov 15, 2000 at 06:33 UTC | |
by chromatic (Archbishop) on Nov 15, 2000 at 09:43 UTC | |
by jreades (Friar) on Nov 15, 2000 at 21:37 UTC | |
by tilly (Archbishop) on Nov 15, 2000 at 23:23 UTC | |
|
RE (tilly) 1: Object Heirarchy / Design
by tilly (Archbishop) on Nov 15, 2000 at 06:38 UTC | |
by lattice (Initiate) on Nov 15, 2000 at 06:54 UTC | |
by btrott (Parson) on Nov 15, 2000 at 07:53 UTC | |
by tilly (Archbishop) on Nov 15, 2000 at 07:13 UTC | |
|
RE: Object Heirarchy / Design
by metaperl (Curate) on Nov 15, 2000 at 19:30 UTC |