Main > Programming > Libraries >

Class::Std::Storable 0.0.1

Class::Std::Storable 0.0.1

Sponsored Links

Class::Std::Storable 0.0.1 Ranking & Summary

RankingClick at the star to rank
Ranking Level
User Review: 0 (0 times)
File size: 0.008 MB
Platform: Any Platform
License: Perl Artistic License
Price:
Downloads: 1012
Date added: 2007-01-15
Publisher: Luke Meyer

Class::Std::Storable 0.0.1 description

Class::Std::Storable is a Perl module to support for creating serializable "inside-out" classes.

SYNOPSIS

In general, use this class exactly as you would Class::Std.

package Ice::Cream;
use Class::Std::Storable;
{
my %name_of :ATTR( :get :set );
my %flavor_of :ATTR( :get :set );
}

package main;
my $object = Ice::Cream->new;
$object->set_name("Vanilla Bean");
$object->set_flavor("vanilla");
But now, you may also serialize the object with Storable.
use Storable;
my $serialized = Storable::freeze($object);
#store to a file, database, or wherever, and retrieve later.
my $clone = Storable::thaw($serialized);

Class::Std introduced the "inside-out" model for classes (perldoc Class::Std for details). Among its salient features is complete encapsulation; that is, an objects data may only be accessed via its methods, unlike the usual hashref model that permits direct access by any code whatsoever. However, the drawback of complete encapsulation is that normal mechanisms for serialization wont work, as they rely on direct access to an objects attributes.

This class provides the class-building functionality from Class::Std, and in addition provides an interface to allow Storable to freeze and thaw any declared attributes of this class and any superclasses that were built via Class::Std::Storable.

However, in order to let Storable save attributes and construct the object, it is necessary to expose the attributes of the class to the world. Thus, any code could use the same interface that Storable does to get a copy of object attributes and create new objects with arbitrary attributes without going through the constructor. While the interface CANT be used to replace the existing attributes of an object, it COULD be used to create an arbitrarily mutated clone of an object without going through its methods. Also, if attributes are themselves references, then the objects to which they refer can be obtained and modified.

As true encapsulation is one of the major features of Class::Std, this would be a good reason NOT to use this class. But this sacrifice is required to provide serialization. You must choose which is more important for your purposes, serialization or complete encapsulation. Consider also that while bypassing the class methods is possible to a limited degree with Class::Std::Storable, doing so is much more complicated than just using the methods, so use of this class still discourages casual violations of encapsulation.

Class::Std::Storable 0.0.1 Screenshot

Advertisements

Class::Std::Storable 0.0.1 Keywords

Bookmark Class::Std::Storable 0.0.1

Hyperlink code:
Link for forum:

Class::Std::Storable 0.0.1 Copyright

WareSeeker periodically updates pricing and software information of Class::Std::Storable 0.0.1 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Class::Std::Storable 0.0.1 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed

Allok Video Splitter 2.2.0 Review:

Name (Required)
Email(Required)
Captcha
Featured Software

Want to place your software product here?
Please contact us for consideration.

Contact WareSeeker.com
Related Software
Class::Std is a Perl module to support for creating standard "inside-out" classes. Free Download
Class::Std::Utils is a Perl module for utility subroutines for building "inside-out" objects. Free Download
Class::Observable is a Perl module that allows other classes and objects to respond to events in yours. Free Download
Class::Simple is a simple Object-Oriented Base Class. Free Download
Class::DBI::FormBuilder is a Perl module with Class::DBI/CGI::FormBuilder integration. Free Download
Class::Declare is a Perl module created to declare classes with public, private and protected attributes and methods. Free Download
Class::Driver is a Perl module to generate driver ("composite") class hierarchies on-the-fly. Free Download
Class::StrongSingleton is a stronger and more secure Singleton base class. Free Download