Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 976 Categories, Downloaded 30.120.052 Times

Class::Declare 0.08

  Date Added: July 20, 2010  |  Visits: 413

Class::Declare

Report Broken Link
Printer Friendly Version


Product Homepage
Download (70 downloads)

Class::Declare is a Perl module created to declare classes with public, private and protected attributes and methods. SYNOPSIS package My::Class; use strict; use warnings; use base qw( Class::Declare ); __PACKAGE__->declare( public => { public_attr => 42 } , private => { private_attr => Foo } , protected => { protected_attr => Bar } , class => { class_attr => [ 3.141 ] } static => { static_attr => { a => 1 } } , restricted => { restricted_attr => string } , abstract => abstract_attr , friends => main::trustedsub , new => [ public_attr , private_attr ] , init => sub { # object initialisation ... 1; } , strict => 0 ); sub publicmethod { my $self = __PACKAGE__->public( shift ); ... } sub privatemethod { my $self = __PACKAGE__->private( shift ); ... } sub protectedmethod { my $self = __PACKAGE__->protected( shift ); ... } sub classmethod { my $self = __PACKAGE__->class( shift ); ... } sub staticmethod { my $self = __PACKAGE__->static( shift ); ... } sub restrictedmethod { my $self = __PACKAGE__->restricted( shift ); ... } sub abstractmethod { __PACKAGE__->abstract } 1; ... my $obj = My::Class->new( public_attr => fish ); MOTIVATION One of Perls greatest strengths is its flexible object model. You can turn anything (so long as its a reference, or you can get a reference to it) into an object. This allows coders to choose the most appropriate implementation for each specific need, and still maintain a consistent object oriented approach. A common paradigm for implementing objects in Perl is to use a blessed hash reference, where the keys of the hash represent attributes of the class. This approach is simple, relatively quick, and trivial to extend, but its not very secure. Since we return a reference to the hash directly to the user they can alter hash values without using the classs accessor methods. This allows for coding "short-cuts" which at best reduce the maintainability of the code, and at worst may introduce bugs and inconsistencies not anticipated by the original module author. On some systems, this may not be too much of a problem. If the developer base is small, then we can trust the users of our modules to Do The Right Thing. However, as a modules user base increases, or the complexity of the systems our modules are embedded in grows, it may become desirable to control what users can and cant access in our module to guarantee our codes behaviour. A traditional method of indicating that an objects data and methods are for internal use only is to prefix attribute and method names with underscores. However, this still relies on the end user Doing The Right Thing. Class::Declare provides mechanisms for module developers to explicitly state where and how their class attributes and methods may be accessed, as well as hiding the underlying data store of the objects to prevent unwanted tampering with the data of the objects and classes. This provides a robust framework for developing Perl modules consistent with more strongly-typed object oriented languages, such as Java and C++, where classes provide public, private, and protected interfaces to object and class data and methods..

Requirements: No special requirements
Platforms: Linux
Keyword: Attr Classdeclare Libraries Module Package Perl Module Private Programming Protected Public Sub
Users rating: 0/10

License: Freeware Size: 76.8 KB
CLASS::DECLARE RELATED
Libraries  -  Alien Perl module 0.91
Alien Perl module package contains external libraries wrapped up for your viewing pleasure! SYNOPSIS perldoc Alien; Alien is a package that exists just to hold together an idea, the idea of Alien:: packages, so there is no code here, just...
10.24 KB  
Libraries  -  OpenGeoDB Perl module 0.4
OpenGeDB Perl module is a module to access the OpenGeoDB database and calculate all ZIP codes in a certain radius..
3.07 KB  
Libraries  -  Module::Signature 0.55
Module::Signature is a Perl module signature file manipulation. SYNOPSIS As a shell command: % cpansign # verify an existing SIGNATURE, or # make a new one if none exists % cpansign sign # make signature; overwrites existing one %...
68.61 KB  
Libraries  -  Test::AutoBuild::Runtime 1.2.0
Test::AutoBuild::Runtime is a Perl module with builder runtime state. SYNOPSIS use Test::AutoBuild::Runtime; my $runtime = new Test::AutoBuild::Runtime (archive_manager => $archive_manager, monitors => %monitors, repositories =>...
204.8 KB  
Network & Internet  -  MyCMS perl module 1.0
MyCMS perl module provides the MN::CMS Perl module used by the MyCMS. MyCMS perl module contains Perl object classes to manage the data of MyCMS (such as articles, links, and images). MN::CMS is a perl module that allows you to manage an...
16.38 KB  
Libraries  -  Apache::PAR::tutorial 0.30
Apache::PAR::tutorial is a Perl module with information on getting Apache::PAR up and running. Apache::PAR is a framework for including Perl ARchive files in a mod_perl (1.x or 2.x) environment. It allows an author to package up a web...
25.6 KB  
Libraries  -  XML::EasySQL::XMLobj::Node 1.2
XML::EasySQL::XMLobj::Node is a Perl module that contains a Node interface. Derived from a fork of Robert Hansons killer XML::EasyOBJ module, which offers Easy XML object navigation. METHODS makeNewNode( NEW_TAG ) Append a new element node...
11.26 KB  
Libraries  -  Convert::CEGH::Gematria 0.02
Convert::CEGH::Gematria is a Perl module for Coptic/Ethiopic/Greek/Hebrew Gematria. SYNOPSIS use utf8; use Convert::CEGH::Gematria enumerate; print "Hebrew: ž“ => ", enumerate ( "ž“" ), "n";...
6.14 KB  
Libraries  -  Java::Import 0.03
Java::Import is Perl module to use Java classes in Perl. SYNOPSIS use Java::Import qw( some.package.SomeClass ); my $instance = new some.package.SomeClass(); $instance->someMethod(); my $ret_val =...
28.67 KB  
Libraries  -  dtRdr::Traits::Class 0.0.11
dtRdr::Traits::Class is a Perl module with shared OO stuff. Methods to Break Things NOT_IMPLEMENTED Imported into base class. Gives a nicer message than the standard "Cant locate method...", indicating that you did not typo the method name,...
2.8 MB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by freedesktop.org, it is used to describe information about an application such as the name and...
327.68 KB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB  
Libraries  -  wolfSSL 3.12.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
2.73 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB