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:
and so on.my $me = new Person; $me->age(22);
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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |