On Jul 13, Scott R. Godin said:

The first thing you need to do is figure out the mapping from the old methods to the new methods.

I'm not quite certain what you're getting at, here. You mean, which methods will get re-mapped to do things slightly differently for the DB version?

Right. What needs to be done in the DB methods? And I sort of answered that: update a local copy of the object from the DB, and then call the parent method.

I also added an $obj->set() method (again slightly different from the above so you'd get warnings about unbalanced pairs) for handling multiple field/value pairs which again checks to make sure the fields are allowed and accessible. I'm pondering whether I should be doing the same thing twice (in new() and set()), and whether it makes any sense to have new call (a slightly different variant of) set.

I don't see why not.

  sub new {
    my $class = shift;
    my $self = bless {}, $class;
    $self->set(@_);
    return $self;
  }

There's no need for that '%' prototype on your set() function, by the way. Methods don't pay attention to prototypes, anyway.

--
Jeff "japhy" Pinyan         %  How can we ever be the sold short or
RPI Acacia Brother #734     %  the cheated, we who for every service
http://japhy.perlmonk.org/  %  have long ago been overpaid?
http://www.perlmonks.org/   %    -- Meister Eckhart

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to