> Handling the "more than one instance" case is no
> different than
> designing any other method that is designed to be
> called multiple times,
> with separate data stores for each. It can be done.
>
> The storage could be like:
>
> $self->{TT}->{instance_1}
> $self->{TT}->{instance_2}
>
I think we're debating around the edges now.
Why separate the data store from the object? If
instance_1 and instance_2 are refs to their objects,
as opposed to a data store, that would be more in line
with regular object oriented programming. Your way,
the plugin object needs to know which instance of the
data store belongs to it, or which it otherwise wants
to use at a particular time. Instead of just
referring to itself for data:
$plugin_self_instance_1->{mydata};
you need something like:
$plugin_self_shared->get_mydata( {instance =>
instance_1, data_key => mydata } );
Plus, why not let a plugin user be able to specify
certain things upon creation, such as exporting or a
tag or the label (ie, in your example "instance_1".)
Even if we go with your "data store" approach, why not
add one more level of indirection to allo
$self->{TT}->{instance_2}{data}
$self->{TT}->{instance_2}{export_flag}
etc.
Bill
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]