Re: [RDBO] Read-only objects

2007-04-05 Thread Jonathan Vanasco
On Apr 5, 2007, at 4:06 AM, Ovid wrote: > That's an important backup and one I recommend. However, I don't want > to see a permissions error hundreds of lines and several modules away > from the actual cause: > > $mc->hammer("can't touch this"); > > It's important to have the exceptions thrown

Re: [RDBO] Read-only objects

2007-04-05 Thread Randal L. Schwartz
> "Tim" == Tim Bunce <[EMAIL PROTECTED]> writes: Tim> If it's to hide the sub from caller(), why bother? OCD, probably. :) I like a clean backtrace when I can get it. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 http://www.stonehenge.com/merlyn/> Perl/Un

Re: [RDBO] Read-only objects

2007-04-05 Thread Ovid
--- Jonathan Vanasco <[EMAIL PROTECTED]> wrote: > I just use a bad db handle for all things rose, then have a custom > method that pulls a read-only or read/write handle from a db factory > as needed. ie, they'll always fail on save, insert, update because > they don't have the db permissio

Re: [RDBO] Read-only objects

2007-04-05 Thread Tim Bunce
On Wed, Apr 04, 2007 at 09:20:30AM -0700, Randal L. Schwartz wrote: > > Here's what I did for my readonly class, based on discussions with jcs > six months ago: > > sub insert { > die "cannot insert" unless our $READWRITE; > goto &{$_[0]->can("SUPER::insert")}; > } Hi Randal.

Re: [RDBO] Read-only objects

2007-04-05 Thread Ovid
--- "Randal L. Schwartz" wrote: > sub insert { > die "cannot insert" unless our $READWRITE; > goto &{$_[0]->can("SUPER::insert")}; > } > > sub update { > die "cannot update" unless our $READWRITE; > goto &{$_[0]->can("SUPER::update")}; > } > > sub dele