SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG

 
 

perl-Class-Tangram rpm build for : openSUSE Tumbleweed. For other distributions click perl-Class-Tangram.

Name : perl-Class-Tangram
Version : 1.570.0 Vendor : obs://build_opensuse_org/devel:languages:perl
Release : 1.4 Date : 2024-03-08 00:20:41
Group : Unspecified Source RPM : perl-Class-Tangram-1.570.0-1.4.src.rpm
Size : 0.12 MB
Packager : (none)
Summary : Tangram-friendly classes, DWIM attributes
Description :
Class::Tangram is a tool for defining objects attributes. Simply define
your object\'s fields/attributes using the same data structure introduced in
_A Guided Tour of Tangram_ (see SEE ALSO) and detailed in Tangram::Schema,
and you get objects that work As You\'d Expect(tm).

Class::Tangram has no dependancy upon Tangram, and vice versa. Neither
requires anything special of your objects, nor do they insert any special
fields into your objects. This is a very important feature with innumerable
benefits, and few (if any) other object persistence tools have this
feature.

So, fluff aside, let\'s run through how you use Class::Tangram to make
objects.

First, you decide upon the attributes your object is going to have. You
might do this using UML, or you might pick an existing database table and
declare each column to be an attribute (you can leave out \"id\"; that one is
implicit; also, leave out foreign keys until later).

Your object should use Class::Tangram as a base class;

use base qw(Class::Tangram)

or for older versions of perl:

use Class::Tangram;
use vars qw(AATTISA);
AATTISA = qw(Class::Tangram)

You should then define a \'$fields\' variable in the scope of the package,
that is a *hash* from attribute *types* (see Tangram::Type) to either an
*array* of *attribute names*, or another *hash* from *attribute names* to
*options hashes* (or \'undef\'). The layout of this structure coincides
exactly with the \'fields\' portion of a tangram schema (see
Tangram::Schema), though there are some extra options available.

This will hereon in be referred to as the `object schema\' or just `schema\'.

For example,

package Orange;
use base qw(Class::Tangram);

our $fields = {
int => {
juiciness => undef,
segments => {




check_func => sub {
die \"too many segments\"
if (${(shift)} > 30);
},

init_default => 7,
},
},
ref => {
grower => {
},
},



string => {


type => { required => 1 },


tag => { required => \'\' },
},



transient => [ qw(_tangible) ],
};

It is of critical importance to your sanity that you understand how
anonymous hashes and anonymous arrays work in Perl. Some additional
features are used above that have not yet been introduced, but you should
be able to look at the above data structure and see that it satisfies the
conditions stated in the paragraph before it. If it is hazy, I recommend
reading perlref or perlreftut.

When the schema for the object is first imported (see Schema import),
Class::Tangram defines accessor functions for each of the attributes
defined in the schema. These accessor functions are then available as
\'$object->function\' on created objects. By virtue of inheritance, various
other methods are available.

From Class::Tangram 1.12 onwards, perl\'s \'AUTOLOAD\' feature is not used to
implement accessors; closures are compiled when the class is first used.

RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl/openSUSE_Tumbleweed/noarch

Content of RPM  Changelog  Provides Requires

Download
ftp.icm.edu.pl  perl-Class-Tangram-1.570.0-1.4.noarch.rpm
     

Provides :
perl(Class::Tangram)
perl(Class::Tangram::Generator)
perl(Tangram::Transient)
perl-Class-Tangram

Requires :
perl(:MODULE_COMPAT_5.40.0)
perl(Date::Manip) >= 5.21
perl(Set::Object) >= 1.04
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsZstd) <= 5.4.18-1


Content of RPM :
/usr/lib/perl5/vendor_perl/5.40.0/Class
/usr/lib/perl5/vendor_perl/5.40.0/Class/Tangram
/usr/lib/perl5/vendor_perl/5.40.0/Class/Tangram.pm
/usr/lib/perl5/vendor_perl/5.40.0/Class/Tangram/Containers.pod
/usr/lib/perl5/vendor_perl/5.40.0/Class/Tangram/Generator
/usr/lib/perl5/vendor_perl/5.40.0/Class/Tangram/Generator.pm
/usr/lib/perl5/vendor_perl/5.40.0/Class/Tangram/Generator/Stub.pm
/usr/share/doc/packages/perl-Class-Tangram
/usr/share/doc/packages/perl-Class-Tangram/Changes
/usr/share/doc/packages/perl-Class-Tangram/README
/usr/share/man/man3/Class::Tangram.3pm.gz
/usr/share/man/man3/Class::Tangram::Containers.3pm.gz
/usr/share/man/man3/Class::Tangram::Generator.3pm.gz

 
ICM