Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    Myco::Entity 1.22

    Download button

    No screenshots available
    Downloads: 333  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Charles Owens | More programs
    Perl Artistic License / FREE
    October 20th, 2006, 21:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Myco::Entity description

    Myco::Entity is a common base class for all Myco entity classes.

    Myco::Entity is a common base class for all Myco entity classes.

    SYNOPSIS

    ### Entity class definition

    package Myco::Foo;
    use base qw(Myco::Entity);

    # Start building metadata
    my $metadata = Myco::Entity::Meta->new
    ( name => __PACKAGE__,
    tangram => { table => 'Foo' }
    );

    $metadata->add_attribute(name => 'attr1', type => 'string');
    $metadata->add_attribute(name => 'attr2', type => 'string');

    # class-specific methods defined ...
    #

    # Fill in $schema with all added_attributes and discover other metadata
    $metadata->activate_class;



    ### Entity class usage

    use Myco::Foo;

    # Constructor
    $obj = Myco::Foo->new;
    $obj = Myco::Foo->new(attr1 => value, attr2 => value);

    # Access class metadata (see Myco::Entity::Meta)
    $meta = Myco::Foo->introspect;
    $meta = $obj->introspect;

    # Accessors
    $obj->get_attr1; # get attribute value
    $obj->set_attr1('value'); # set attribute value

    # Instance methods
    $id = $obj->save; # update object's state in persistent
    # storage, create new record if needed;
    # returns object's Tangram id
    $obj->destroy;
    $obj->modify(attr1 => val, attr2 => val);
    $object_id = $obj->id;
    $obj->is_transient; # returns true if object is in Tangram
    # transient storage

    ## object retrieval (see class Myco documentation
    # for full detail)

    $obj = Myco->load($object_id);

    # fetch all objects of given type
    @objects = Myco->select(ref $obj);

    Provides, via inheritence, common interface in support of basic lifecycle needs for myco entity objects.

    This is accomplished through the encapsulation of the CPAN module Class::Tangram which provides a basis for "in-memory" object behavior. Consult its documentation for details on schema definition syntax, getter/setter behavior, check functions, etc.

    The common interface for object persistence behavior (referred within myco as "transaction" behavior) is provided through defintion of a handful of related instance methods. This is done with reliance on the services of the class Myco, which encapsulates the functionality of Tangram::Storage and provides system-wide connection handling.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    Myco entity | Myco class | Perl module | Myco::Entity | Myco | entity

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM