On 9/26/05, Terrence Brannon <[EMAIL PROTECTED]> wrote:
> Without seeing an example of the the two different invocations, I
> can't comment. The CVS version is not on search.cpan.org yet (I
> guess).

When I post about changes to CVS, it's stuff that's not ready to go up
to CPAN yet :)

> I found the file for the CVS version
> (http://cvs.sourceforge.net/viewcvs.py/rose/rose/modules/Rose-DB-Object/lib/Rose/DB/Object.pm?rev=1.15&view=markup)
> but I don't have examples of current and previous usage, so I still
> can't compare.

The SF CVS browser lags the actual repository.  You can see the latest
version of that file here:

http://cvs.sourceforge.net/viewcvs.py/rose/rose/modules/Rose-DB-Object/lib/Rose/DB/Object.pm?rev=1.18

In the docs for load() is this explanation:

---

B<SUBCLASS NOTE:> If you are going to override the L<load|/load>
method in your subclass, you I<must> pass an I<alias to the actual
object> as the first argument to the method, rather than passing a
copy of the object reference.  Example:

    # This is the CORRECT way to override load() while still
    # calling the base class version of the method.
    sub load
    {
      my $self = $_[0]; # Copy, no shift

      ... # Do your stuff

      shift->SUPER::load(@_); # Call superclass
    }

Now here's the wrong way:

    # This is the WRONG way to override load() while still
    # calling the base class version of the method.
    sub load
    {
      my $self = shift; # WRONG!  The alias to original object is now lost!

      ... # Do your stuff

      $self->SUPER::load(@_); # This won't work right!
    }

This requirement exists in order to preserve some sneaky
object-replacement optimizations in the base class implementation of
L<load|/load>.  At some point, those optimizations may change or go
away.  But if you follow these guidelines, your code will continue to
work no matter what.

---

-John


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to