http://www.employees.org/~thepler/Romo-0.01.tar.gz
I'd be glad to take any feedback on this proof-of-concept.
There were several potential directions to go with this. I just ended up picking one that seems to work for the time being. It's all pretty rough. One of my objectives is to make something that is satisfying from both the relational and object-oriented perspectives. The hypothesis being that the object-relational impedance mismatch is a myth.
A couple notes... There is no SQL. There is no persistence. Remember, the relational model != SQL.
The book spends some time talking about "value types". I'm
no expert on type systems but I think these map to "immutable types"
in the Perl 6 spec. And these get involved with === and WHICH. Since
I'm doing this in Perl 5 and Moose, I made up a way to do === and
WHICH. So === is spelled is_identical, and it's a method instead
of an operator. And WHICH is still spelled WHICH, but it's ->WHICH
instead of
If you're familiar with "Database in Depth" you may want to look at t/01.database_in_depth_example.t. There's some cruft, but it makes "types" and relations for the running example in the book and performs some relational operations on them.
There are questions that I still have about the current approach to types/classes. To some extent, this is a learning exercise for me, so I intend to push things until I hit some kind of wall. I'm also being conservative about what can happen, and throwing exceptions to enforce it until I figure what out the implications of loosening those constraints are.
I haven't been looking at optimizations yet either. I'm trying to get the interfaces and functionality correct before worrying about speed.
I've been using Muldis for reference. In particular, the names of the methods in Romo::Relation are taken from there.
Random thing on my TODO radar: