NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Database Abstractions (Score:2)
The benefits of database abstractions such as Class::DBI are obvious, but the downsides of these technologies can hamper scalability. On one hand, with the CDBI approach, we have a clear mapping of classes to tables, but the databases for which these have been designed are relational when classes tend to be heirarchical. This not only forces developers to accept awkward design constraints (subclassing a table can be an act of supreme masochism), but with the wrong design, it can also limit scalability.
Re:Database Abstractions (Score:2)
Re:Database Abstractions (Score:2)
I thought that Postgres can double as an object database, complete with table leve inheritence. I've never played with those features, though.
Re:Database Abstractions (Score:2)
Re:Database Abstractions (Score:2)
Dang. I seemed a bit crabby in that, didn't I? I think I made the situation sound worse than it really is.
Re:Database Abstractions (Score:2)
I haven't used Class::DBI in very many projects, but it does make the process of writing an abstraction for a simple database downright painless. I've also written a couple of thin database frameworks, so I've got an idea of what the problem domain is about.
The situation you described feels like a heavyweight OODB mapping. I don't think that's an accurate description
Re:Database Abstractions (Score:2)
Well, one thing that might help is to implement a "one table" interface. Imagine that your boss wants a report of the average sales per salesperson. If everything was in one big table, you could write:
Of course, such a database would be impossible to manage, but if you treat it like that, you can drop the FROM clause:
Re:Database Abstractions (Score:1)
I think people who try to use Class::DBI and friends to isolate them from SQL are chasing the wrong goal. I don't need isolation from SQL -- SQL is easy and works great! All I want is for the busywork code that does all the obvious work to be automated for me, which is what Class::DBI
Re:Database Abstractions (Score:1)
> more ad hoc queries. Writing custom SQL for each
> one becomes problematic
Why is this problematic? If you have to write non-trivial queries to get information out of a database, how else would you expect to be able to do that?
This isn't meant to be a snippy response - I'm truly interested in what other sorts of ways this sort of thing could be done.
Tony
Popping up everywhere (Score:2)
--Nat
Re:Popping up everywhere (Score:2)
Re:Popping up everywhere (Score:2)
Ask 'im about regexes. And tell 'em that we don't need no stinkin' autoboxing because we don't do that silly "primitives in an OO world" mess :)
Re:Popping up everywhere (Score:1)
Re:Popping up everywhere (Score:2)
Given that Perl hackers avoid huge bloated object frameworks [archive.org], either something is wrong with us [archive.org], or something is wrong with those frameworks [archive.org].
If Class::DBI and Hibernate are converging on a similar set of goals, and if EJB / AWT / Swing are being rejected by Java programmers en masse, then I'd say we really were onto something all those years ago.
Re:Popping up everywhere (Score:1)
> similar set of goals...
I've never encountered Hibernate before. I just had a look. It scared me.
I can live with having SQL mixed with Perl. XML is just a step too far
I have made a few notes on interesting ideas that might be worth stealing for Class::DBI though.
Tony
Re:Popping up everywhere (Score:1)
I like to think of JCP as a herd of elephant real estate speculators staking out claims in the ever-expanding frontier of The Core Libraries. No other image really captures the elegance, precision, simplicity, and unashamed piles of excreta in their wake.
For fun, go to the JavaOne exhibit hall, yell out "I have a new API for controlling coconut-throwing monkeys", step back, and enjoy the stampede. If the 18-month standardization process doesn't produce a library that includes some sort of rocketry, I'll