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.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    Class::Simple 0.18

    Download button

    No screenshots available
    Downloads: 351  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Poor (1.5/5)
    2 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Michael Sullivan | More programs
    Perl Artistic License / FREE
    January 31st, 2008, 11:04 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Class::Simple description

    Class::Simple is a simple Object-Oriented Base Class.

    Class::Simple is a simple Object-Oriented Base Class.

    SYNOPSIS

    package Foo:
    use base qw(Class::Simple);

    BEGIN
    {
    Foo->privatize(qw(attrib1 attrib2)); # ...or not.
    }
    my $obj = Foo->new();

    $obj->attrib(1); # The same as...
    $obj->set_attrib(1); # ...this.

    my $var = $obj->get_attrib(); # The same as...
    $var = $obj->attrib; # ...this.

    $obj->raise_attrib(); # The same as...
    $obj->set_attrib(1); # ...this.

    $obj->clear_attrib(); # The same as...
    $obj->set_attrib(undef); # ...this
    $obj->attrib(undef); # ...and this.

    $obj->readonly_attrib(4);

    sub foo
    {
    my $self = shift;
    my $value = shift;

    $self->_foo($value);
    do_other_things(@_);
    ...
    }

    my $str = $obj->DUMP;
    my $new_obj = Foo->new();
    $new_obj->SLURP($str);

    sub BUILD
    {
    my $self = shift;

    # Various initializations
    }

    There are plenty of others that are much more thorough and whatnot but sometimes I want something simple so I can get just going (no doubt because I am a simple guy) so I use this.

    What do I mean by simple? First off, I don't want to have to list out all my methods beforehand. I just want to use them (Yeah, yeah, it doesn't catch typos--that's what testing and Class::Std are for :-). Next, I want to be able to call my methods by $obj->foo(1) or $obj->set_foo(1), by $obj->foo() or $obj->get_foo(). Don't tell ME I have to use get_ and set_ (I would just override that restriction in Class::Std anyway). Simple!

    I did want some neat features, though, so these are inside-out objects (meaning the object isn't simply a hash so you can't just go in and muck with attributes outside of methods), privatization of methods is supported, as is serialization out and back in again.

    Requirements:

    · Perl

    What's New in This Release:

    · Took out the conflict resolution feature. There was a problem caused by multiple inheritance.
    · Removed uninitialized().



    Product's homepage

      


    TAGS:

    Object-Oriented class | Perl class | Perl module | Class::Simple | Object-Oriented | class

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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