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

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

Serving Software Downloads in 956 Categories, Downloaded 50.213.705 Times

Class::Declare 0.08

  Date Added: July 20, 2010  |  Visits: 610

Class::Declare

Report Broken Link
Printer Friendly Version


Product Homepage
Download (88 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
USER REVIEWS
More Reviews or Write Review


CLASS::DECLARE RELATED
Libraries  -  Sub::Slice::Manual 1.048
Sub::Slice::Manual is a Perl module with user guide for Sub::Slice. USING Sub::Slice Sub::Slice is a way of breaking down a long-running process and maintaining state across a stateless protocol. This allows the client to draw a progress bar...
27.65 KB  
Libraries  -  perlfaq3 5.8.8
perlfaq3 Perl module contains programming tools. How do I do (anything)? Have you looked at CPAN (see perlfaq2)? The chances are that someone has already written a module that can solve your problem. Have you read the appropriate manpages?...
12.2 MB  
Modules  -  Protected Download (downld) 5.x-1.0
This module makes it possible for public and private download to co-exists on Apache web servers.This module is developed by Thomas Barregren at NodeOne.The development of this module has been sponsored by: * SSPA Sweden * NodeOneProtected...
10 KB  
Modules  -  Download 5.x- 1.0
The module automatically makes files public or private based on node type.InstallationUnpack in your modules folder (usually /sites/all/modules/) and enable under Administer > Site Building > Modules.The module automatically makes files public or...
 
Modules  -  Download 5.x- 1.0
The module automatically makes files public or private based on node type.InstallationUnpack in your modules folder (usually /sites/all/modules/) and enable under Administer > Site Building > Modules.The module automatically makes files public or...
 
Modules  -  Download 5.x- 1.0
The module automatically makes files public or private based on node type.InstallationUnpack in your modules folder (usually /sites/all/modules/) and enable under Administer > Site Building > Modules.The module automatically makes files public or...
 
Development Editors  -  PHP for Linux 5. 3. 2008
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. Instead of lots of commands to output HTML (as...
10 MB  
Network & Internet  -  mypypi 1.0.0
This package provides a private python package index server based on Zope 3. The MyPyPi server provides everything you need for setup a private or public pypi mirror. It also allows to release closed source packages. Together with...
286.72 KB  
File Security  -  Packman 2.01
Encryption for email and attachments, or store private files on public servers. PackMan (Package Manager) stores files within it's own compressed and ciphered file format. Built in RTF common word processing format. Use of the built in...
440 KB  
Libraries  -  Happytime NAT Traversal Library 1.0
Happytime PPLib is a NAT Traversal and private network (LAN) access library. It can access to a private network of computers and network equipment from another private network or public network. The advantage is no need to configure port mapping...
12.18 MB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
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  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 4.0.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...
3.88 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