Am 27.09.2010 01:55 schrieb Chris Prather: > On Sun, Sep 26, 2010 at 7:40 PM, Ernesto > <[email protected]> wrote: >> Dear fans of Elks and Mooses, >> >> here is a module making your favorite pets persistent. >> >> It's called Frost - Feasible Referential Object STorage. >> >> Frost is an extension of Moose providing persistence even to circular >> structures. > > How dos this differentiate from KiokuDB? > First I have to admit, that I didn't dive into KiokuDBs source code, but looked only at the docs. But that gave me the impression, not to use KiokuDB but to write some own stuff.
Frost is not meant as competitor to KiokuDB, it has just another way to look at the problem of persistence. While KiokuDB seems to be a full blown frontend with many different database backends including SQL storing any possible Perl object, Frost only claims to store just Moose objects, more precisely: objects inheriting from Frost::Locum, which is an extended Moose::Object. That doesn't mean, you can't use foreign classes with Frost - just store them in transient or virtual attributes and they're working but not saved. It's astounding, what we can do by omitting some (esoteric) features like mutability, weak refs or roles and adding - using the excellent meta stuff of Moose - some sugar to the attribute definition. Therefore migration from a SQL database might be easy, because Frost comes with indexes on attributes i.e.. While with KiokuDB you'll have to keep track on scopes to handle weak refs, it's unnecessary with Frost due to its proxy mechanism. On the other hand with Frost you never can rely on the physical address of an object - so address-comparing, -arithmetics etc. are verboten. Here is an example how to handle loops with an UUID with Frost and KiokuDB: http://dienstleistung-kultur.de/frost/loop_frost.pl http://dienstleistung-kultur.de/frost/loop_kiokudb.pl And for a quick overview here are the differences: http://dienstleistung-kultur.de/frost/loop_patch.diff (Yes, I really succeeded to install KiokoDB by waiting for zillions of dependent modules, some of them only installable by force and some I never heard of including deprecated (?) Mouse). Frost manages all its persistent stuff in the background; the only thing you have to know is the /existing/path/for/your/data, while at six feet under BerkleyDB does its clandestine work. With KiokuDB you have to know i.e. all about connecting to a SQL database and you have to define the database tables a priori. Frost maybe easier to be deployed as KiokuDB, because it's only needed to add or change a basic class to use Frost instead of Moose - all other classes in the inheritance tree can be coded in the fashion of standard Moose. With KiokuDB an extra base class is not needed, but you have to save every object explicitly after creation or changing, while with Frost every change is automatically saved as long as you say $asylum->close at the end of your program. Yes, Frost has its limitations, but they are intended. Nota bene: I don't want to start a flame war - both modules have their right to exist depending on the user's aim. I'm looking forward to your use cases, which are not handled by Frost. Maybe we can find a solution. Ernesto 8-) -- Ernst-J. "Ernesto" Johnsdorf mailto:[email protected] http://search.cpan.org/~ernesto/ http://dienstleistung-kultur.de
