in reply to Object Heirarchy / Design
The idea behind your system, it seems to me, is that you want objects that are basically input-output neutral: they can be read from anywhere, and they can be written to anywhere. So what you want (and it sounds like what you have) is a series of polymorphic input and output drivers, such that you can provide a transparent transparent interface to the various input and output sources.
With that said, then, I would have one main object that doesn't inherit from anything. That object, in my system, would be of type "Obj". That's it. It would maintain *state* about its input and output drivers, so that when it came time to read and write this object, you could dispatch to the appropriate driver. So I might say:
and this would, under the hood, do the following:my $obj = Obj->get('DB', @params);
Obj::Input::DB->get(@params)
The reason I would bless my object into Obj, rather than into a driver-specific input class, is that I find that confusing: your object is generic, and it's not tied to a particular input class. So why add restrictions that aren't already there?
With respect to inheritance, I'd have a main Obj class that inherits from nothing. That's your main object class. Then either one of two things:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: Object Heirarchy / Design
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 |