On Apr 6, 2007, at 12:04 PM, Ovid wrote:

> On a side note, the code you posted for making things 'read only'
> seemed a bit complicated for me.  I simply do something similar to
> this:
>
>   package My::DataCentre;
>
>   use base 'My::Rose::DB::Object';
>
>   sub meta_class { 'My::Rose::DB::Metaclass::ReadOnly' }

This just kind of hit me too--

As a quick-and-dirty fix, one could also make an object out of a  
Database read-only view.

I think you *should* be able to just:
        a- create a view that selects from the db and returns the same cols  
as the real item
        b- subclass the RODB obj and just change the table name in the  
package meta.

Which would give you a RODB obj that will always fail on DB writes.

Granted, that only works on DBs that support VIEW






// Jonathan Vanasco

| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -
| SyndiClick.com
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -
|      FindMeOn.com - The cure for Multiple Web Personality Disorder
|      Web Identity Management and 3D Social Networking
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -
|      RoadSound.com - Tools For Bands, Stuff For Fans
|      Collaborative Online Management And Syndication Tools
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to