Class::DBI and stalinesque hiding of THE TRUTH

Simon Wistow simon at thegestalt.org
Fri Jun 23 10:10:30 BST 2006


I have a Class::DBI app. Rewriting it in $your_favourite_orm is not an 
option. It's running on MySQL. Changing to another DB is not an option. 
These are not my rules. I am working within these constraints.

It's a fairly standard set up - there are a bunch of Entities and 
Entities have various other attributes like Tags and Owners.

All this is working fine.

However I now wish to make it so that some Entities are hidden from 
general consumption based on a flag and that two different front ends 
will display the data differently.

I'd rather not have the frontend check to see if every Entitis 
is_public() and also, when listing, say Tags, I'd preferably not like 
Tags that are attached to no public Entities to show up.

Is there a clever way I can do this using cunning trickery? Possibly 
views or something. My DB skills are, at present, as weak as a kitten on 
Ludes who's also in traction and wasn't particularly strong in the first 
place and used to get sand kicked in its face by other, larger kittens 
when down at the kitten beach.

I eagerly await the fruits of your exceptional cleverity.

Simon



-- 
X-Gleitschirmfliegen: macht Spaaaasss!




More information about the london.pm mailing list