My 'read-only' objects now have their very own metadata class. Trying
to update from the 'save', 'insert', 'update', etc. now fails. I also
have the accessors throwing Exception::Class objects if someone tries
to set an attribute value. However, it's a nasty hack because the
other code examples
--- Ovid [EMAIL PROTECTED] wrote:
My 'read-only' objects now have their very own metadata class.
As a side note, it might be nice if a 'readonly' metadata class were
natively available in Rose::DB::Object, with an optional way of
allowing it to be read/write. I know I can create said objects
Ovid == Ovid [EMAIL PROTECTED] writes:
Ovid The hack relies on the order of call stack frames being different when
Ovid I'm constructing an object or just setting an accessor directly. How
Ovid can I do this without relying on the internals like this?
It seems like everyone using RDBO
On 4 Apr 2007, at 17:21, John Siracusa wrote:
[snip]
The only way to distinguish the two is by calling context. That
said, there
are (slightly) better ways to detect the context than using caller().
Here's what I suggest:
# Override init in you common base class
# (See the
On 4/4/07 12:37 PM, Adrian Howard wrote:
Since there are at least three folk who have wanted this sort of
functionality - would it be worth adding something like
is_initialising() to Rose::DB::Object::Util? Just to prevent
gratuitous wheel reinvention :-)
No, since that'd require extra
call me lazy--
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 permissions