You're a star, this is pretty close to what I'm after.
There are reasons why I am using Tangram over, say, Class::DBI:
- Support for Polymorphism in data types
- Support for non-trivial relationships between classes (sets, arrays, etc)
- Objects that contain/refer to other objects are automatically loaded as needed via a tied variable
- Queries are in Perl, not SQL. This is achieved with a very clever trick - having a variable type that represents a "remote" (that is, not local) object, and overloading functions on that so you can do, eg $db->select($remote_orange, $remote_orange->{field} eq "value");. This returns a data structure that can be converted by the object data persistence engine to a SQL query.
What I think is the direction from here is to refine Class::Contract to the point where it is suitable for generating storage schemas; be they Tangram or Class::DBI or Alzabo or whatever. "Scalar" is, by definition, of boundless length, which isn't too useful if you want to store it in a column of a relational database.
Thanks for the pointer, I guess I'll take up this conversation with the Class::* maintainers. The POOP list, which seemed the natural place for this, seemed worryingly quiet.
srand 3.14159; print join("",
sort{rand 1<0.5}map{$_^"\037"}split m{
}x,"qmptk|z~wOzm??l]pUqx^k?j"),",\n";
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.