The point of Tangram isn't that it's "object-oriented"--the point, I think, is that it lets you have persistent objects w/o worrying about how to make them persistent. So rather than you having to worry about how to structure your database to hold a bunch of your objects, and you writing the SQL to store them, you can concentrate on how to use the objects, in Perl. Tangram takes care of the storage in the database.

For example, say you have data about a bunch of people. You know their name, their age, and their hair color. You create a simple Perl object to hold this data, and you can instantiate it at will:

my $me = new Person; $me->age(22);
and so on.

Now, what if you want to make these objects persistent? In other words, between runs of your program, you need to store this data somewhere. A database is as good a place as any.

The problem, though, is that placing your database code into your object (into a save method, for example) would make your code very specific. Objects should be more flexible about how they're stored--they shouldn't be tied in to only one storage method.

This is where Tangram comes in: it provides the methods that let you store your object in a database. So you can create it, store it, quit your program, then start it up again--and load your object from the database magically, as if it had never left.

So it's not a matter of you being forced/cajoled/etc. into writing object-oriented code. The point here is that you're *already* writing OO code, and now you need a way to store your objects. You need object persistence, and that's what Tangram gives you.

I've never used it myself, though. :)


In reply to Re: Tangram by btrott
in thread Tangram by httptech

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.