Class::DBI and stalinesque hiding of THE TRUTH
Andy Wardley
abw at wardley.org
Sat Jun 24 19:44:43 BST 2006
Simon Wistow wrote:
> 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.
Forgive me if I'm mistaking obvious bleeding for exceptional
cleverityness but can you not just create two different CDBI
abstractions (aka "views") of the underlying database?
For example, you have a RegularEntity class and an ExtraSpecialEntity
class which implements slightly different behavior (your choice as to
how, that's a mere implementation issue). It shouldn't matter a jot if
they happen to point at the same database table, implement the same
public interfaces, or otherwise. That's the beauty of abstraction.
FrontEndOne displays RegularEntities while FrontEndTwo displays
ExtraSpecialEntities and neither end should know nor care how any of the
entities relate to each other (other than by what they expose in their
public interfaces). For that is the way of the model, and not the way
of the view. Nor is it the way of any kittens that happen to be hanging
around with the view on the off-chance that it throws them a piece of
fish or offers to take them for a day out on Kitten Beach.
My apologies if I have failed to understand the true nature of your
dilemma and have grasped the stick by the end that the stick designer
did not intend for it to be grabbed by. In which case I prostrate
myself upon Kitten Beach and await the kicking of sand in my stupid
little kitten face.
A
More information about the london.pm
mailing list